This commit is contained in:
slonkazoid 2025-02-26 23:42:15 +07:00 committed by GitHub
commit f8fe9dea78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 195 additions and 1 deletions

28
include/env.h Normal file
View file

@ -0,0 +1,28 @@
#ifndef _SWAY_ENV_H
#define _SWAY_ENV_H
/**
* Deallocates an environment array created by
* sway_env_get_envp or sway_env_setenv.
*/
void env_destroy(char **envp);
/**
* Gets a newly-allocated environment array pointer
* from the global environment.
*/
char **env_create();
/**
* Sets or overwrites an environment variable in the given environment.
* Setting a new variable will reallocate the entire array.
*/
char **env_setenv(char **envp, char *name, char *value);
/**
* Unsets an environment variable in the given environment.
* If successful, this will reallocate the entire array.
*/
char **env_unsetenv(char **envp, char *name);
#endif

View file

@ -125,6 +125,8 @@ sway_cmd cmd_create_output;
sway_cmd cmd_default_border;
sway_cmd cmd_default_floating_border;
sway_cmd cmd_default_orientation;
sway_cmd cmd_env;
sway_cmd cmd_env_unset;
sway_cmd cmd_exec;
sway_cmd cmd_exec_always;
sway_cmd cmd_exit;