19 lines
525 B
C
19 lines
525 B
C
|
|
#ifndef HOOKS_H
|
||
|
|
#define HOOKS_H
|
||
|
|
|
||
|
|
#include "logger.h"
|
||
|
|
|
||
|
|
/*
|
||
|
|
* Run cmd in a shell with working directory set to working_dir.
|
||
|
|
* stdout and stderr from the hook are streamed through log.
|
||
|
|
*
|
||
|
|
* Returns the hook's exit status (0 = success, >0 = hook failure),
|
||
|
|
* or -1 if the shell could not be launched.
|
||
|
|
*
|
||
|
|
* The caller is responsible for distinguishing hook failure from build
|
||
|
|
* failure — this function never touches build state.
|
||
|
|
*/
|
||
|
|
int hook_run(const char *cmd, const char *working_dir, Logger *log);
|
||
|
|
|
||
|
|
#endif /* HOOKS_H */
|