Commit Graph

7 Commits

Author SHA1 Message Date
Shawn O. Pearce
b7c891c629 Add git_oid_cpy, git_oid_cmp as inline functions
These are easily built off the standard C library functions memcpy
and memcmp.  By marking these inline we stand a good chance of
the C compiler replacing the entire thing with tight machine code,
because many compilers will actually inline a memcmp or memcpy when
the 3rd argument (the size) is a constant value.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-03 18:43:04 -08:00
Shawn O. Pearce
3b8ab0b935 Fix GIT_EXTERN to actually mark the prototype as extern
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-03 18:42:54 -08:00
Shawn O. Pearce
fbbfdf9f13 Move GIT_NORETURN into test_lib.h only
We should never have a noreturn style function in the library
itself, as such a function would prevent the calling application
from handling error conditions the way it wants.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-03 18:42:54 -08:00
Shawn O. Pearce
15bffce9f7 Create a basic test suite for the library and test oid functions
This is a horribly simple test suite that makes it fairly easy to
put together some basic function level unit tests on the library.
Its patterned somewhat after the test suite in git.git, but also
after the "Check" test library.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-01 18:24:39 -07:00
Shawn O. Pearce
16a67770b7 Create a micro abstraction around the POSIX file APIs
This way we can start to write IO code to read and write files in the
Git object database, but provide a hook to inject native Win32 APIs
instead so libgit2 can be ported to run natively on that platform.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-01 16:53:06 -07:00
Shawn O. Pearce
50298f44a4 Switch the license from BSD to GPL+libgcc exception
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-01 15:55:47 -07:00
Shawn O. Pearce
d1ea30c399 Move include files to include/git/, drop git_ prefix from file names
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-11-01 15:42:23 -07:00