Blame


1 0c9bd0c5 2018-02-12 stsp /*
2 0c9bd0c5 2018-02-12 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 0c9bd0c5 2018-02-12 stsp *
4 0c9bd0c5 2018-02-12 stsp * Permission to use, copy, modify, and distribute this software for any
5 0c9bd0c5 2018-02-12 stsp * purpose with or without fee is hereby granted, provided that the above
6 0c9bd0c5 2018-02-12 stsp * copyright notice and this permission notice appear in all copies.
7 0c9bd0c5 2018-02-12 stsp *
8 0c9bd0c5 2018-02-12 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 0c9bd0c5 2018-02-12 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 0c9bd0c5 2018-02-12 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 0c9bd0c5 2018-02-12 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 0c9bd0c5 2018-02-12 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 0c9bd0c5 2018-02-12 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 0c9bd0c5 2018-02-12 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 0c9bd0c5 2018-02-12 stsp */
16 0c9bd0c5 2018-02-12 stsp
17 0c9bd0c5 2018-02-12 stsp /* A symbolic reference. */
18 0c9bd0c5 2018-02-12 stsp struct got_symref {
19 0c9bd0c5 2018-02-12 stsp char *name;
20 0c9bd0c5 2018-02-12 stsp char *ref;
21 0c9bd0c5 2018-02-12 stsp };
22 0c9bd0c5 2018-02-12 stsp
23 0c9bd0c5 2018-02-12 stsp /* A non-symbolic reference (there is no better designation). */
24 0c9bd0c5 2018-02-12 stsp struct got_ref {
25 0c9bd0c5 2018-02-12 stsp char *name;
26 0c9bd0c5 2018-02-12 stsp u_int8_t sha1[SHA1_DIGEST_LENGTH];
27 0c9bd0c5 2018-02-12 stsp };
28 0c9bd0c5 2018-02-12 stsp
29 0c9bd0c5 2018-02-12 stsp /* A reference which points to an arbitrary object. */
30 0c9bd0c5 2018-02-12 stsp struct got_reference {
31 0c9bd0c5 2018-02-12 stsp unsigned int flags;
32 0c9bd0c5 2018-02-12 stsp #define GOT_REF_IS_SYMBOLIC 0x01
33 0c9bd0c5 2018-02-12 stsp
34 0c9bd0c5 2018-02-12 stsp union {
35 0c9bd0c5 2018-02-12 stsp struct got_ref ref;
36 0c9bd0c5 2018-02-12 stsp struct got_symref symref;
37 0c9bd0c5 2018-02-12 stsp } ref;
38 0c9bd0c5 2018-02-12 stsp };