mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-03 03:59:08 +00:00
This adds the per-thread global variable git_errno to the system, which callers can examine to get information about an error. Two helper functions are added to reduce LoC-count for the library code itself. Also, some exceptions are made for running sparse on GIT_TLS definitions, since it doesn't grok thread-local variables at all. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
26 lines
493 B
C
26 lines
493 B
C
#ifndef INCLUDE_git_errors_h__
|
|
#define INCLUDE_git_errors_h__
|
|
/**
|
|
* @file git/errors.h
|
|
* @brief Git error handling routines and variables
|
|
* @ingroup Git
|
|
* @{
|
|
*/
|
|
|
|
#include "common.h"
|
|
#include "thread-utils.h"
|
|
GIT_BEGIN_DECL
|
|
|
|
/** The git errno. */
|
|
GIT_EXTERN(int) GIT_TLS git_errno;
|
|
|
|
/**
|
|
* strerror() for the Git library
|
|
* @param num The error code to explain
|
|
* @return a string explaining the error code
|
|
*/
|
|
GIT_EXTERN(const char *) git_strerror(int num);
|
|
/** @} */
|
|
GIT_END_DECL
|
|
#endif
|