Commit 0ed5750f authored by sletz's avatar sletz
Browse files

Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3558 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 786e7127
......@@ -25,6 +25,10 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-06-05 Stephane Letz <letz@grame.fr>
* Correct jack_set_error_function, jack_set_info_function and jack_set_thread_creator functions.
2009-05-18 Stephane Letz <letz@grame.fr>
* Correct wcsript files to create jackdbus only (and not create jackd anymore) when compiled in --dbus mode, add a --classic option. Both options are possible but issue a warning.
......
......@@ -278,12 +278,12 @@ static inline void WaitGraphChange()
EXPORT void jack_set_error_function (print_function func)
{
jack_error_callback = func;
jack_error_callback = (func == NULL) ? &default_jack_error_callback : func;
}
EXPORT void jack_set_info_function (print_function func)
{
jack_info_callback = func;
jack_info_callback = (func == NULL) ? &default_jack_info_callback : func;
}
EXPORT jack_client_t* jack_client_new(const char* client_name)
......@@ -1799,7 +1799,7 @@ EXPORT int jack_client_kill_thread(jack_client_t* client, pthread_t thread)
#ifndef WIN32
EXPORT void jack_set_thread_creator (jack_thread_creator_t jtc)
{
JackGlobals::fJackThreadCreator = jtc;
JackGlobals::fJackThreadCreator = (jtc == NULL) ? pthread_create : jtc;
}
#endif
......
......@@ -118,17 +118,23 @@ SERVER_EXPORT void jack_log(const char *fmt,...)
}
}
static void default_jack_error_callback(const char *desc)
SERVER_EXPORT void default_jack_error_callback(const char *desc)
{
fprintf(stderr, "%s\n", desc);
fflush(stderr);
}
static void default_jack_info_callback (const char *desc)
SERVER_EXPORT void default_jack_info_callback(const char *desc)
{
fprintf(stdout, "%s\n", desc);
fflush(stdout);
}
SERVER_EXPORT void silent_jack_error_callback(const char *desc)
{}
SERVER_EXPORT void silent_jack_info_callback(const char *desc)
{}
SERVER_EXPORT void (*jack_error_callback)(const char *desc) = &default_jack_error_callback;
SERVER_EXPORT void (*jack_info_callback)(const char *desc) = &default_jack_info_callback;
......@@ -45,6 +45,12 @@ extern "C"
SERVER_EXPORT extern void (*jack_error_callback)(const char *desc);
SERVER_EXPORT extern void (*jack_info_callback)(const char *desc);
SERVER_EXPORT extern void default_jack_error_callback(const char *desc);
SERVER_EXPORT extern void default_jack_info_callback(const char *desc);
SERVER_EXPORT extern void silent_jack_error_callback(const char *desc);
SERVER_EXPORT extern void silent_jack_info_callback(const char *desc);
typedef void (* jack_log_function_t)(int level, const char *message);
......@@ -52,8 +58,8 @@ extern "C"
void jack_log_function(int level, const char *message);
SERVER_EXPORT void set_threaded_log_function();
extern int jack_verbose;
extern int jack_verbose;
#ifdef __cplusplus
}
......
......@@ -76,9 +76,6 @@ static void notify_server_stop(const char* server_name)
#endif
static void silent_jack_error_callback(const char *desc)
{}
static void copyright(FILE* file)
{
fprintf(file, "jackdmp " VERSION "\n"
......
......@@ -1047,6 +1047,7 @@ extern void (*jack_error_callback)(const char *msg);
/**
* Set the @ref jack_error_callback for error message display.
* Set it to NULL to restore default_jack_error_callback function.
*
* The JACK library provides two built-in callbacks for this purpose:
* default_jack_error_callback() and silent_jack_error_callback().
......@@ -1065,6 +1066,10 @@ extern void (*jack_info_callback)(const char *msg);
/**
* Set the @ref jack_info_callback for info message display.
* Set it to NULL to restore default_jack_info_callback function.
*
* The JACK library provides two built-in callbacks for this purpose:
* default_jack_info_callback() and silent_jack_info_callback().
*/
void jack_set_info_function (void (*func)(const char *));
......
......@@ -116,8 +116,8 @@ int jack_client_stop_thread(jack_client_t* client, pthread_t thread);
* @returns 0, if successful; otherwise an error number.
*/
int jack_client_kill_thread(jack_client_t* client, pthread_t thread);
#ifndef WIN32
#ifndef WIN32
typedef int (*jack_thread_creator_t)(pthread_t*,
const pthread_attr_t*,
......@@ -137,11 +137,13 @@ int jack_client_stop_thread(jack_client_t* client, pthread_t thread);
* that all threads that might call win32 functions are known
* to Wine.
*
* Set it to NULL to restore thread creation function.
*
* @param creator a function that creates a new thread
*
*/
void jack_set_thread_creator (jack_thread_creator_t creator);
void jack_set_thread_creator (jack_thread_creator_t creator);
#endif
/* @} */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment