mirror of
https://github.com/swaywm/sway.git
synced 2026-04-28 06:46:26 -04:00
swaymsg: remove dependency on stringop.h
This commit is contained in:
parent
320fe4ad30
commit
da51d5f424
1 changed files with 16 additions and 1 deletions
|
|
@ -12,12 +12,27 @@
|
||||||
#include <json-c/json.h>
|
#include <json-c/json.h>
|
||||||
#include "ipc-client.h"
|
#include "ipc-client.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "stringop.h"
|
|
||||||
|
|
||||||
void sway_terminate(int exit_code) {
|
void sway_terminate(int exit_code) {
|
||||||
exit(exit_code);
|
exit(exit_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *join_args(char **argv, int argc) {
|
||||||
|
int len = 0, i;
|
||||||
|
for (i = 0; i < argc; ++i) {
|
||||||
|
len += strlen(argv[i]) + 1;
|
||||||
|
}
|
||||||
|
char *res = malloc(len);
|
||||||
|
len = 0;
|
||||||
|
for (i = 0; i < argc; ++i) {
|
||||||
|
strcpy(res + len, argv[i]);
|
||||||
|
len += strlen(argv[i]);
|
||||||
|
res[len++] = ' ';
|
||||||
|
}
|
||||||
|
res[len - 1] = '\0';
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static bool success_object(json_object *result) {
|
static bool success_object(json_object *result) {
|
||||||
json_object *success;
|
json_object *success;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue