mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 01:38:16 +00:00
26 lines
659 B
C
26 lines
659 B
C
#ifndef NEOVIM_API_HELPERS_H
|
|
#define NEOVIM_API_HELPERS_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "api/defs.h"
|
|
|
|
#define set_api_error(message, err) \
|
|
do { \
|
|
strncpy(err->msg, message, sizeof(err->msg)); \
|
|
err->set = true; \
|
|
} while (0)
|
|
|
|
/// Start block that may cause vimscript exceptions
|
|
void try_start(void);
|
|
|
|
/// End try block, set the error message if any and return true if an error
|
|
/// occurred.
|
|
///
|
|
/// @param err Pointer to the stack-allocated error object
|
|
/// @return true if an error occurred
|
|
bool try_end(Error *err);
|
|
|
|
#endif /* NEOVIM_API_HELPERS_H */
|
|
|