SDL Visual Test

- Main Page
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Typedefs | Functions
SDL_visualtest_process.h File Reference
`#include <SDL_platform.h>`

Go to the source code of this file.

## Data Structures
struct | SDL_ProcessInfo
struct | SDL_ProcessExitStatus

## Typedefs
typedef struct SDL_ProcessInfo | SDL_ProcessInfo
typedef struct SDL_ProcessExitStatus | SDL_ProcessExitStatus

## Functions
int | SDL_LaunchProcess (char *file, char *args, SDL_ProcessInfo *pinfo)
int | SDL_IsProcessRunning (SDL_ProcessInfo *pinfo)
int | SDL_KillProcess (SDL_ProcessInfo *pinfo, SDL_ProcessExitStatus *ps)
int | SDL_QuitProcess (SDL_ProcessInfo *pinfo, SDL_ProcessExitStatus *ps)
int | SDL_GetProcessExitStatus (SDL_ProcessInfo *pinfo, SDL_ProcessExitStatus *ps)

## Detailed Description

Provides cross-platfrom process launching and termination functionality.

## Typedef Documentation

typedef struct SDL_ProcessExitStatus SDL_ProcessExitStatus

This structure stores the exit status (value returned by main()) and whether the process exited sucessfully or not.

typedef struct SDL_ProcessInfo SDL_ProcessInfo

Struct to store a platform specific handle to a process.

## Function Documentation

int SDL_GetProcessExitStatus | ( | SDL_ProcessInfo * | pinfo,
|  | SDL_ProcessExitStatus * | ps
| ) |  |

Gets the exit status of a process. If the exit status is -1, the process is still running.

Parameters

  pinfo | Pointer to a SDL_ProcessInfo object of the process to be checked.
  ps | Pointer to a SDL_ProcessExitStatus object which will be populated with the exit status.

Returns
  1 on success, 0 on failure.

int SDL_IsProcessRunning | ( | SDL_ProcessInfo * | pinfo) |  |

Checks if a process is running or not.

Parameters

  pinfo | Pointer to SDL_ProcessInfo object of the process that needs to be checked.

Returns
  1 if the process is still running; zero if it is not and -1 if the status could not be retrieved.

int SDL_KillProcess | ( | SDL_ProcessInfo * | pinfo,
|  | SDL_ProcessExitStatus * | ps
| ) |  |

Kills a currently running process.

Parameters

  pinfo | Pointer to a SDL_ProcessInfo object of the process to be terminated.
  ps | Pointer to a SDL_ProcessExitStatus object which will be populated with the exit status.

Returns
  1 on success, 0 on failure.

int SDL_LaunchProcess | ( | char * | file,
|  | char * | args,
|  | SDL_ProcessInfo * | pinfo
| ) |  |

Launches a process with the given commandline arguments.

Parameters

  file | The path to the executable to be launched.
  args | The command line arguments to be passed to the process.
  pinfo | Pointer to an SDL_ProcessInfo object to be populated with platform specific information about the launched process.

Returns
  Non-zero on success, zero on failure.

int SDL_QuitProcess | ( | SDL_ProcessInfo * | pinfo,
|  | SDL_ProcessExitStatus * | ps
| ) |  |

Cleanly exits the process represented by `pinfo` and stores the exit status in the exit status object pointed to by `ps`.

Returns
  1 on success, 0 on failure.