src/common.h


Log

Author Commit Date CI Message
Ramsay Jones 75d58430 2008-12-18T22:56:14 Add a file reading routine along with an io buffer type In particular, the gitfo_read_file() routine can be used to slurp the complete file contents into an gitfo_buf structure. The buffer content will be allocated by malloc() and may be released by the gitfo_free_buf() routine. The io buffer type can be initialised on the stack with the GITFO_BUF_INIT macro. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Ramsay Jones 5ee2fe77 2008-12-03T23:53:55 Add a GIT_PATH_MAX constant The PATH_MAX symbol is often, but not always, defined in the <limits.h> header. In particular, on cygwin you need to include this header to avoid a compilation error. However, some systems define PATH_MAX to be something as small as 256, which POSIX is happy to allow, while others allow much larger values. In general it can vary from one filesystem to another. In order to avoid the vagaries of different systems, define our own symbol. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Andreas Ericsson ae234862 2008-11-18T22:20:15 Add an embryo of a TLS-aware error handling system 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>
Andreas Ericsson 3a2aabdc 2008-11-22T14:44:47 Add util.h - utility macros ARRAY_SIZE() et al go in util.h, included from common.h Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Andreas Ericsson 76a8c447 2008-11-22T14:42:12 Add internal common.h file This one pulls in compiler compatibility macros, some common header files, and also the public common.h header. C source files are modified to use the private common.h in favour of the public one. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>