~lattis/muon

ref: f9a8cbad39b665a9496cd3adb4756e85ee5ec97c muon/include/args.h -rw-r--r-- 978 bytes
f9a8cbadStone Tickle print stdout/stderr of failing test 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef MUON_ARGS_H
#define MUON_ARGS_H

#include "lang/workspace.h"

struct args {
	const char **args;
	uint32_t len;
};

bool ninja_escape(char *buf, uint32_t len, const char *str);

void push_args(struct workspace *wk, uint32_t arr, const struct args *args);
void push_argv_single(const char **argv, uint32_t *len, uint32_t max, const char *arg);
void push_argv(const char **argv, uint32_t *len, uint32_t max, const struct args *args);

uint32_t join_args_plain(struct workspace *wk, uint32_t arr);
uint32_t join_args_shell(struct workspace *wk, uint32_t arr);
uint32_t join_args_ninja(struct workspace *wk, uint32_t arr);
bool join_args_argv(struct workspace *wk, char **argv, uint32_t len, uint32_t arr);

bool arr_to_args(struct workspace *wk, uint32_t arr, uint32_t *res);

enum build_envp_flags {
	build_envp_flag_subdir    = 1 << 0,
	build_envp_flag_dist_root = 1 << 1,
};

bool build_envp(struct workspace *wk, char *const *ret[], enum build_envp_flags flags);
#endif