// vim:fileencoding=utf-8:foldmethod=marker

#ifndef COMMANDER_H
#define COMMANDER_H

#include "commander_output.h"
#include "../../../common/aliases/aliases.h"
#include "../../../common/platform/platform.h"
#include "../../../base/strings/str8/str8.h"
#include <stdio.h>
#include <stdlib.h>

// TODO (Abdelrahman): This module needs rethinking

#ifdef WP_PLATFORM_CPP
BEGIN_C_LINKAGE
#endif // !WP_PLATFORM_CPP

#define wpCmdNoExit(ERR) ((WpCmdResult){.exited = false, .exit_code = EXIT_FAILURE, .error = ERR})

WpCmdResult wpShellCommanderExecute(WpCmdOutHandling out_handling, WpStr8 *out_buf, const WpStr8List *cmd);

wp_extern WpCmdError _getOutputStatus(FILE *fp, i32 *status_out);

#ifdef WP_PLATFORM_CPP
END_C_LINKAGE
#endif // !WP_PLATFORM_CPP

#endif // !COMMANDER_H
