-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ad22e4
commit 0cb511c
Showing
14 changed files
with
523 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_CleanupEnvironment | ||
|
||
Cleanup the process environment. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
void SDL_CleanupEnvironment(void); | ||
``` | ||
## Remarks | ||
This is called during [SDL_Quit](SDL_Quit)() to free the process | ||
environment. If [SDL_GetEnvironment](SDL_GetEnvironment)() is called | ||
afterwards, it will automatically create a new environment copied from the | ||
C runtime environment. | ||
## Thread Safety | ||
This function is not thread-safe. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_GetEnvironment](SDL_GetEnvironment) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_CreateEnvironment | ||
|
||
Create a set of environment variables | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
SDL_Environment * SDL_CreateEnvironment(SDL_bool empty); | ||
``` | ||
## Function Parameters | ||
| | | | | ||
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- | | ||
| [SDL_bool](SDL_bool) | **empty** | [SDL_TRUE](SDL_TRUE) to create an empty environment, [SDL_FALSE](SDL_FALSE) to initialize it from the C runtime environment. | | ||
## Return Value | ||
([SDL_Environment](SDL_Environment) *) Returns a pointer to the new | ||
environment or NULL on failure; call [SDL_GetError](SDL_GetError)() for | ||
more information. | ||
## Thread Safety | ||
If `empty` is [SDL_TRUE](SDL_TRUE), it is safe to call this function from | ||
any thread, otherwise it is safe if no other threads are calling setenv() | ||
or unsetenv() | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
- [SDL_DestroyEnvironment](SDL_DestroyEnvironment) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_DestroyEnvironment | ||
|
||
Destroy a set of environment variables. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
void SDL_DestroyEnvironment(SDL_Environment *env); | ||
``` | ||
## Function Parameters | ||
| | | | | ||
| ------------------------------------ | ------- | --------------------------- | | ||
| [SDL_Environment](SDL_Environment) * | **env** | the environment to destroy. | | ||
## Thread Safety | ||
It is safe to call this function from any thread, as long as the | ||
environment is no longer in use. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_CreateEnvironment](SDL_CreateEnvironment) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_Environment | ||
|
||
A thread-safe set of environment variables | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
typedef struct SDL_Environment SDL_Environment; | ||
``` | ||
|
||
## Version | ||
|
||
This struct is available since SDL 3.0.0. | ||
|
||
## See Also | ||
|
||
- [SDL_GetEnvironment](SDL_GetEnvironment) | ||
- [SDL_CleanupEnvironment](SDL_CleanupEnvironment) | ||
- [SDL_CreateEnvironment](SDL_CreateEnvironment) | ||
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
- [SDL_DestroyEnvironment](SDL_DestroyEnvironment) | ||
|
||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIDatatype](CategoryAPIDatatype), [CategoryStdinc](CategoryStdinc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_GetEnvironment | ||
|
||
Get the process environment. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
SDL_Environment * SDL_GetEnvironment(void); | ||
``` | ||
## Return Value | ||
([SDL_Environment](SDL_Environment) *) Returns a pointer to the environment | ||
for the process or NULL on failure; call [SDL_GetError](SDL_GetError)() for | ||
more information. | ||
## Remarks | ||
This is initialized at application start and is not affected by setenv() | ||
and unsetenv() calls after that point. Use | ||
[SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable)() and | ||
[SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable)() if you want | ||
to modify this environment. | ||
## Thread Safety | ||
It is safe to call this function from any thread. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_CleanupEnvironment](SDL_CleanupEnvironment) | ||
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_GetEnvironmentVariable | ||
|
||
Get the value of a variable in the environment. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
const char * SDL_GetEnvironmentVariable(SDL_Environment *env, const char *name); | ||
``` | ||
## Function Parameters | ||
| | | | | ||
| ------------------------------------ | -------- | -------------------------------- | | ||
| [SDL_Environment](SDL_Environment) * | **env** | the environment to query. | | ||
| const char * | **name** | the name of the variable to get. | | ||
## Return Value | ||
(const char *) Returns a pointer to the value of the variable or NULL if it | ||
can't be found. | ||
## Thread Safety | ||
It is safe to call this function from any thread. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_GetEnvironment](SDL_GetEnvironment) | ||
- [SDL_CreateEnvironment](SDL_CreateEnvironment) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_GetEnvironmentVariables | ||
|
||
Get all variables in the environment. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
char ** SDL_GetEnvironmentVariables(SDL_Environment *env); | ||
``` | ||
## Function Parameters | ||
| | | | | ||
| ------------------------------------ | ------- | ------------------------- | | ||
| [SDL_Environment](SDL_Environment) * | **env** | the environment to query. | | ||
## Return Value | ||
(char **) Returns a NULL terminated array of pointers to environment | ||
variables in the form "variable=value" or NULL on failure; call | ||
[SDL_GetError](SDL_GetError)() for more information. This is a single | ||
allocation that should be freed with [SDL_free](SDL_free)() when it is no | ||
longer needed. | ||
## Thread Safety | ||
It is safe to call this function from any thread. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_GetEnvironment](SDL_GetEnvironment) | ||
- [SDL_CreateEnvironment](SDL_CreateEnvironment) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_SetEnvironmentVariable](SDL_SetEnvironmentVariable) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
###### (This is the documentation for SDL3, which is under heavy development and the API is changing! [SDL2](https://wiki.libsdl.org/SDL2/) is the current stable version!) | ||
# SDL_SetEnvironmentVariable | ||
|
||
Set the value of a variable in the environment. | ||
|
||
## Header File | ||
|
||
Defined in [<SDL3/SDL_stdinc.h>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/SDL_stdinc.h) | ||
|
||
## Syntax | ||
|
||
```c | ||
SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite); | ||
``` | ||
## Function Parameters | ||
| | | | | ||
| ------------------------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [SDL_Environment](SDL_Environment) * | **env** | the environment to modify. | | ||
| const char * | **name** | the name of the variable to set. | | ||
| const char * | **value** | the value of the variable to set. | | ||
| [SDL_bool](SDL_bool) | **overwrite** | [SDL_TRUE](SDL_TRUE) to overwrite the variable if it exists, [SDL_FALSE](SDL_FALSE) to return success without setting the variable if it already exists. | | ||
## Return Value | ||
([SDL_bool](SDL_bool)) Returns [SDL_TRUE](SDL_TRUE) on success or | ||
[SDL_FALSE](SDL_FALSE) on failure; call [SDL_GetError](SDL_GetError)() for | ||
more information. | ||
## Thread Safety | ||
It is safe to call this function from any thread. | ||
## Version | ||
This function is available since SDL 3.0.0. | ||
## See Also | ||
- [SDL_GetEnvironment](SDL_GetEnvironment) | ||
- [SDL_CreateEnvironment](SDL_CreateEnvironment) | ||
- [SDL_GetEnvironmentVariable](SDL_GetEnvironmentVariable) | ||
- [SDL_GetEnvironmentVariables](SDL_GetEnvironmentVariables) | ||
- [SDL_UnsetEnvironmentVariable](SDL_UnsetEnvironmentVariable) | ||
---- | ||
[CategoryAPI](CategoryAPI), [CategoryAPIFunction](CategoryAPIFunction), [CategoryStdinc](CategoryStdinc) | ||
Oops, something went wrong.