session: run shutdown script, clean up activation env before exit

This commit is contained in:
Andrew J. Hesford 2024-02-18 12:23:14 -05:00
parent 4ddeb3cd42
commit f90b7dca2a
6 changed files with 157 additions and 16 deletions

View file

@ -43,4 +43,23 @@ void string_truncate_at_pattern(char *buf, const char *pattern);
*/
char *strdup_printf(const char *fmt, ...);
/**
* str_join - format and join an array of strings with a separator
* @parts: NULL-terminated array of string parts to be joined
* @fmt: printf-style format string applied to each part
* @sep: separator inserted between parts when joining
*
* A new string is allocated to hold the joined result. The user must free the
* returned string. Returns NULL on error.
*
* Each part of the array is converted via the equivalent of sprintf(output,
* fmt, part), so fmt should include a single "%s" format specification. If fmt
* is NULL, a default "%s" will be used to copy each part verbatim.
*
* The separator is arbitrary. When the separator is NULL, a single space will
* be used.
*/
char *str_join(const char * const parts[],
const char *restrict fmt, const char *restrict sep);
#endif /* LABWC_STRING_HELPERS_H */