annotate gcc/go/gofrontend/go-sha1.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // go-sha1.h -- GCC specific sha1 checksum utilities. -*- C++ -*-
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 // Copyright 2016 The Go Authors. All rights reserved.
kono
parents:
diff changeset
4 // Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
5 // license that can be found in the LICENSE file.
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 #ifndef GO_SHA1_H
kono
parents:
diff changeset
8 #define GO_SHA1_H
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 #include "go-system.h"
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 //
kono
parents:
diff changeset
13 // Interface class for computation of SHA1 checksums. Front end requests
kono
parents:
diff changeset
14 // one of these objects from the back end to use for computing
kono
parents:
diff changeset
15 // checksums (each back end tends to have a different SHA1 implementation).
kono
parents:
diff changeset
16 // Back ends are expected to create a new class that derives from this
kono
parents:
diff changeset
17 // one containing an implementation.
kono
parents:
diff changeset
18 //
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 class Go_sha1_helper
kono
parents:
diff changeset
21 {
kono
parents:
diff changeset
22 public:
kono
parents:
diff changeset
23 virtual ~Go_sha1_helper() { }
kono
parents:
diff changeset
24 virtual void process_bytes(const void* buffer, size_t len) = 0;
kono
parents:
diff changeset
25 virtual std::string finish() = 0;
kono
parents:
diff changeset
26 static const int checksum_len = 20;
kono
parents:
diff changeset
27 };
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 // Call to create and return a new sha1 helper (this routine defined
kono
parents:
diff changeset
30 // by the backend). Caller is responsible for deletion.
kono
parents:
diff changeset
31 extern Go_sha1_helper* go_create_sha1_helper();
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 #endif // !defined(GO_SHA1_H)