~lattis/muon

ref: 1c1ab113103e1a2ebcb7edf3a47f826428f8e124 muon/include/platform/run_cmd.h -rw-r--r-- 417 bytes
1c1ab113Stone Tickle extract string.split() 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef MUON_PLATFORM_RUN_CMD_H
#define MUON_PLATFORM_RUN_CMD_H

#include <stdbool.h>
#include <stdint.h>
#include <unistd.h>

struct run_cmd_ctx {
	char *err, *out;
	uint32_t err_len, out_len;
	int status;

	/* error handling */
	const char *err_msg;
};

bool run_cmd(struct run_cmd_ctx *ctx, const char *_cmd, const char *const argv[], char *const envp[]);
void run_cmd_ctx_destroy(struct run_cmd_ctx *ctx);
#endif