muon/include/coerce.h
Stone Tickle 074f34e91c
support cmd_array for external_program
This will be required for find_program('meson') to return an external
program with the command ['muon', 'meson'].  It also allows muon to
return ['muon', 'samu'] as the result for find_program('ninja'), which
is kind of neat.
2023-10-09 10:04:57 -04:00

31 lines
1.5 KiB
C

/*
* SPDX-FileCopyrightText: Stone Tickle <lattis@mochiro.moe>
* SPDX-License-Identifier: GPL-3.0-only
*/
#ifndef MUON_COERCE_H
#define MUON_COERCE_H
#include "functions/common.h"
enum requirement_type {
requirement_skip,
requirement_required,
requirement_auto,
};
bool coerce_environment_from_kwarg(struct workspace *wk, struct args_kw *kw, bool set_subdir, obj *res);
bool coerce_key_value_dict(struct workspace *wk, uint32_t err_node, obj val, obj *res);
bool coerce_include_type(struct workspace *wk, const struct str *str, uint32_t err_node, enum include_type *res);
bool coerce_string_to_file(struct workspace *wk, const char *dir, obj string, obj *res);
bool coerce_string(struct workspace *wk, uint32_t node, obj val, obj *res);
bool coerce_string_array(struct workspace *wk, uint32_t node, obj arr, obj *res);
bool coerce_num_to_string(struct workspace *wk, uint32_t node, obj val, obj *res);
bool coerce_executable(struct workspace *wk, uint32_t node, obj val, obj *res, obj *args);
bool coerce_requirement(struct workspace *wk, struct args_kw *kw_required, enum requirement_type *requirement);
bool coerce_files(struct workspace *wk, uint32_t node, obj val, obj *res);
bool coerce_file(struct workspace *wk, uint32_t node, obj val, obj *res);
bool coerce_dirs(struct workspace *wk, uint32_t node, obj val, obj *res);
bool coerce_output_files(struct workspace *wk, uint32_t node, obj val, const char *output_dir, obj *res);
bool coerce_include_dirs(struct workspace *wk, uint32_t node, obj val, bool is_system, obj *res);
#endif