gva-mame-common

gva-mame-common — Functions common to all MAME backends

Functions

Types and Values

Description

These functions are common to all supported MAME implementations.

Functions

gva_mame_async_data_new ()

GvaMameAsyncData *
gva_mame_async_data_new (GvaMameCallback callback,
                         gpointer user_data);

Creates a new GvaMameAsyncData structure and populates it with callback and user_data . Call gva_mame_async_data_free() to free it.

Parameters

callback

callback function

 

user_data

user data to pass to the callback function

 

Returns

a new GvaMameAsyncData


gva_mame_async_data_free ()

void
gva_mame_async_data_free (GvaMameAsyncData *data);

Frees data .

Parameters

data

a GvaMameAsyncData

 

gva_mame_command ()

gint
gva_mame_command (const gchar *arguments,
                  gchar ***stdout_lines,
                  gchar ***stderr_lines,
                  GError **error);

Spawns MAME with arguments and blocks until the child process exits. The line-based output from the stdout and stderr pipes are written to stdout_lines and stderr_lines , respectively, as NULL-terminated string arrays. The function returns the exit status of the child process, or -1 if an error occurred while spawning the process.

Parameters

arguments

command line arguments

 

stdout_lines

return location for stdout lines, or NULL

 

stderr_lines

return location for stderr lines, or NULL

 

error

return locations for a GError, or NULL

 

Returns

exit status of the child process or -1 if an error occurred

Types and Values

struct GvaMameAsyncData

struct GvaMameAsyncData {
        GvaMameCallback callback;
        gpointer user_data;
};

This structure is used to pass callback information to asynchronous operations.

Members

GvaMameCallback callback;

callback function

 

gpointer user_data;

user data to pass to the callback function