summaryrefslogtreecommitdiff
path: root/src/hash/hash_generic.c
Commit message (Collapse)AuthorAgeFilesLines
* hash: move SHA1 implementations into 'sha1/' folderPatrick Steinhardt2019-06-241-300/+0
| | | | | | | | | | | As we will include additional hash algorithms in the future due to upstream git discussing a move away from SHA1, we should accomodate for that and prepare for the move. As a first step, move all SHA1 implementations into a common subdirectory. Also, create a SHA1-specific header file that lives inside the hash folder. This header will contain the SHA1-specific header includes, function declarations and the SHA1 context structure.
* hash: introduce source files to break include circlesPatrick Steinhardt2019-06-241-3/+15
| | | | | | | | | | | | | | | The hash source files have circular include dependencies right now, which shows by our broken generic hash implementation. The "hash.h" header declares two functions and the `git_hash_ctx` typedef before actually including the hash backend header and can only declare the remaining hash functions after the include due to possibly static function declarations inside of the implementation includes. Let's break this cycle and help maintainability by creating a real implementation file for each of the hash implementations. Instead of relying on the exact include order, we now especially avoid the use of `GIT_INLINE` for function declarations.
* Make sure to always include "common.h" firstPatrick Steinhardt2017-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
* hash_generic: __extension__ keyword for pedantryEdward Thomson2015-02-041-1/+1
|
* Revert "hash: remove git_hash_init from internal api"Michael Schubert2013-02-261-1/+1
| | | | | This reverts commit efe7fad6c96a3d6197a218aeaa561ec676794499, except for the indentation fixes.
* hash: remove git_hash_init from internal apiMichael Schubert2013-02-261-2/+2
| | | | Along with that, fix indentation in tests-clar/object/raw/hash.c
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Remove git_hash_ctx_new - callers now _ctx_init()Edward Thomson2012-11-131-17/+0
|
* Win32 CryptoAPI and CNG support for SHA1Edward Thomson2012-11-131-0/+305