diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-08-02 01:20:12 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-09-25 02:40:23 +0200 |
| commit | 288727f09a1b3458c268497d111349e608c3f9fa (patch) | |
| tree | d62565249fa3c7127856c65405752572fc41aca9 /docs/status.rst | |
Diffstat (limited to 'docs/status.rst')
| -rw-r--r-- | docs/status.rst | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/docs/status.rst b/docs/status.rst new file mode 100644 index 0000000..8ac3628 --- /dev/null +++ b/docs/status.rst @@ -0,0 +1,76 @@ +Result status codes +=================== + +This project adopts widely used convention of returning integer encoded status +codes as function results. + +Each function, that needs to notify it's execution status (success or error), +returns ``lsp_status_t`` (alias for ``lsp_int8_t``). + +Available status codes are: + + * ``LSP_SUCCESS`` + + Execution successful. + + * ``LSP_EOF`` + + End of file encountered during reading/writing. + + * ``LSP_ERR`` + + Generic error (unknown error). + + * ``LSP_ERR_MEM`` + + Memory error (usually out of memory). + + * ``LSP_ERR_CTX`` + + Context error (usually symbol resolution error). + + * ``LSP_ERR_READ`` + + Reader error. + + * ``LSP_ERR_WRITE`` + + Writer error. + + * ``LSP_ERR_EVAL`` + + Evaluation error. + + * ``LSP_ERR_APPLY`` + + Application error. + + * ``LSP_ERR_ARG_COUNT`` + + Invalid argument count. + + * ``LSP_ERR_ARG_TYPE`` + + Invalid argument type. + + * ``LSP_ERR_ARG_VALUE`` + + Invalid argument value. + + * ``LSP_ERR_USER`` + + Special status value representing beginning of user status codes. + +User has ability to raise user error with ``error`` builtin function. This +error is additionally described with integer value in range [0, 126] and +encoded as status code. + + +Source code +----------- + +status.h +'''''''' + +.. literalinclude:: ../src_c/status.h + :language: c |
