Blame


1 6f23baec 2020-03-18 stsp /*
2 6f23baec 2020-03-18 stsp * Copyright (c) 2018, 2019 Ori Bernstein <ori@openbsd.org>
3 6f23baec 2020-03-18 stsp *
4 6f23baec 2020-03-18 stsp * Permission to use, copy, modify, and distribute this software for any
5 6f23baec 2020-03-18 stsp * purpose with or without fee is hereby granted, provided that the above
6 6f23baec 2020-03-18 stsp * copyright notice and this permission notice appear in all copies.
7 6f23baec 2020-03-18 stsp *
8 6f23baec 2020-03-18 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 6f23baec 2020-03-18 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 6f23baec 2020-03-18 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 6f23baec 2020-03-18 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 6f23baec 2020-03-18 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 6f23baec 2020-03-18 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 6f23baec 2020-03-18 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 6f23baec 2020-03-18 stsp */
16 6f23baec 2020-03-18 stsp
17 7ebc0570 2020-03-18 stsp #define GOT_FETCH_DEFAULT_REMOTE_NAME "origin"
18 7ebc0570 2020-03-18 stsp
19 a78567c6 2020-03-18 stsp /*
20 a78567c6 2020-03-18 stsp * Attempt to open a connection to a server using the provided protocol
21 a78567c6 2020-03-18 stsp * scheme, hostname port number (as a string) and server-side path.
22 68999b92 2020-03-18 stsp * A verbosity level can be specified; it currently controls the amount
23 68999b92 2020-03-18 stsp * of -v options passed to ssh(1). If the level is -1 ssh(1) will be run
24 68999b92 2020-03-18 stsp * with the -q option.
25 9c52365f 2020-03-21 stsp *
26 a78567c6 2020-03-18 stsp * If successful return an open file descriptor for the connection which can
27 a78567c6 2020-03-18 stsp * be passed to other functions below, and must be disposed of with close(2).
28 9c52365f 2020-03-21 stsp *
29 9c52365f 2020-03-21 stsp * If an ssh(1) process was started return its PID as well, in which case
30 9c52365f 2020-03-21 stsp * the caller should eventually send SIGTERM to the procress and wait for
31 9c52365f 2020-03-21 stsp * the process to exit with waitpid(2). Otherwise, return PID -1.
32 a78567c6 2020-03-18 stsp */
33 9c52365f 2020-03-21 stsp const struct got_error *got_fetch_connect(pid_t *, int *, const char *,
34 9c52365f 2020-03-21 stsp const char *, const char *, const char *, int);
35 20eb36d0 2020-03-18 stsp
36 531c3985 2020-03-18 stsp /* A callback function which gets invoked with progress information to print. */
37 531c3985 2020-03-18 stsp typedef const struct got_error *(*got_fetch_progress_cb)(void *,
38 668a20f6 2020-03-18 stsp const char *, off_t, int, int, int, int);
39 531c3985 2020-03-18 stsp
40 a78567c6 2020-03-18 stsp /*
41 a78567c6 2020-03-18 stsp * Attempt to fetch a packfile from a server. This pack file will contain
42 a78567c6 2020-03-18 stsp * objects which that are not yet contained in the provided repository.
43 a78567c6 2020-03-18 stsp * Return the hash of the packfile (in form of an object ID) and lists of
44 a78567c6 2020-03-18 stsp * references and symbolic references learned from the server.
45 a78567c6 2020-03-18 stsp */
46 07e52fce 2020-03-18 stsp const struct got_error *got_fetch_pack(struct got_object_id **,
47 7848a0e1 2020-03-19 stsp struct got_pathlist_head *, struct got_pathlist_head *, const char *,
48 0e4002ca 2020-03-21 stsp int, int, struct got_pathlist_head *, struct got_pathlist_head *,
49 118a625d 2023-02-18 mark int, int, int, struct got_repository *, const char *, const char *,
50 118a625d 2023-02-18 mark int, got_fetch_progress_cb, void *);