Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outsource a few GLIB related functions to fluid_sys #901

Merged
merged 2 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bindings/fluid_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fluidsynth.c
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/fluid_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 6 additions & 0 deletions src/utils/fluid_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/utils/fluidsynth_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down