contrib/chg/hgclient.h
author Raphaël Gomès <rgomes@octobus.net>
Mon, 07 Aug 2023 12:53:43 +0200
changeset 50985 c950fdba7472
parent 35998 9724f54923ec
permissions -rw-r--r--
rust: add `UncheckedRevision` type This is the start of a series whose aim is to separate "checked" and "unchecked" revision numbers. A "checked" revision number is valid for a given index, allowing us to have faster algorithms that don't do redundant checks all the time and have a clearer view of the kinds of revisions we're working with.

/*
 * A command server client that uses Unix domain socket
 *
 * Copyright (c) 2011 Yuya Nishihara <yuya@tcha.org>
 *
 * This software may be used and distributed according to the terms of the
 * GNU General Public License version 2 or any later version.
 */

#ifndef HGCLIENT_H_
#define HGCLIENT_H_

#include <sys/types.h>

struct hgclient_tag_;
typedef struct hgclient_tag_ hgclient_t;

hgclient_t *hgc_open(const char *sockname);
void hgc_close(hgclient_t *hgc);

pid_t hgc_peerpgid(const hgclient_t *hgc);
pid_t hgc_peerpid(const hgclient_t *hgc);

const char **hgc_validate(hgclient_t *hgc, const char *const args[],
                          size_t argsize);
int hgc_runcommand(hgclient_t *hgc, const char *const args[], size_t argsize);
void hgc_attachio(hgclient_t *hgc);
void hgc_setenv(hgclient_t *hgc, const char *const envp[]);

#endif /* HGCLIENT_H_ */