mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 15:42:54 +00:00
Merge pull request #901 from paulsapps/glib_optional
Outsource a few GLIB related functions to fluid_sys
This commit is contained in:
commit
13b376819c
5 changed files with 13 additions and 7 deletions
|
@ -441,14 +441,14 @@ fluid_command(fluid_cmd_handler_t *handler, const char *cmd, fluid_ostream_t out
|
|||
return 1;
|
||||
}
|
||||
|
||||
if(!g_shell_parse_argv(cmd, &num_tokens, &tokens, NULL))
|
||||
if(!fluid_shell_parse_argv(cmd, &num_tokens, &tokens))
|
||||
{
|
||||
fluid_ostream_printf(out, "Error parsing command\n");
|
||||
return FLUID_FAILED;
|
||||
}
|
||||
|
||||
result = fluid_cmd_handler_handle(handler, num_tokens, &tokens[0], out);
|
||||
g_strfreev(tokens);
|
||||
fluid_strfreev(tokens);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -896,7 +896,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/* if the automatically selected command file does not exist, do not even attempt to open it */
|
||||
if(!g_file_test(config_file, G_FILE_TEST_EXISTS))
|
||||
if(!fluid_file_test(config_file, FLUID_FILE_TEST_EXISTS))
|
||||
{
|
||||
config_file = NULL;
|
||||
}
|
||||
|
|
|
@ -1730,14 +1730,14 @@ FILE* fluid_file_open(const char* path, const char** errMsg)
|
|||
|
||||
FILE* handle = NULL;
|
||||
|
||||
if(!g_file_test(path, G_FILE_TEST_EXISTS))
|
||||
if(!fluid_file_test(path, FLUID_FILE_TEST_EXISTS))
|
||||
{
|
||||
if(errMsg != NULL)
|
||||
{
|
||||
*errMsg = ErrExist;
|
||||
}
|
||||
}
|
||||
else if(!g_file_test(path, G_FILE_TEST_IS_REGULAR))
|
||||
else if(!fluid_file_test(path, FLUID_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
if(errMsg != NULL)
|
||||
{
|
||||
|
|
|
@ -200,6 +200,12 @@ char* fluid_get_windows_error(void);
|
|||
*/
|
||||
char *fluid_strtok(char **str, char *delim);
|
||||
|
||||
#define FLUID_FILE_TEST_EXISTS G_FILE_TEST_EXISTS
|
||||
#define FLUID_FILE_TEST_IS_REGULAR G_FILE_TEST_IS_REGULAR
|
||||
#define fluid_file_test(path, flags) g_file_test(path, flags)
|
||||
|
||||
#define fluid_shell_parse_argv(command_line, argcp, argvp) g_shell_parse_argv(command_line, argcp, argvp, NULL)
|
||||
#define fluid_strfreev g_strfreev
|
||||
|
||||
#if defined(__OS2__)
|
||||
#define INCL_DOS
|
||||
|
|
|
@ -29,10 +29,10 @@
|
|||
#ifndef _FLUIDSYNTH_PRIV_H
|
||||
#define _FLUIDSYNTH_PRIV_H
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h> // malloc, free
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue