[BACK]Return to remote.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

File: [local] / src / usr.bin / cvs / remote.h (download)

Revision 1.1, Fri Jul 7 17:37:17 2006 UTC (17 years, 10 months ago) by joris
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0

first part of opencvs remote, fairly useable on existing trees
although i advise against using it on real development trees for now.

only a few commands work right so far:
- commit
- diff
- status
- log
- update (partially working)

if you feel like testing remote and run into bugs feel free to
contact me, and please include a full trace (-t).

/*	$OpenBSD: remote.h,v 1.1 2006/07/07 17:37:17 joris Exp $	*/
/*
 * Copyright (c) 2006 Joris Vink <joris@openbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef H_REMOTE
#define H_REMOTE

struct cvs_req {
	char	name[32];
	int	supported;

	void	(*hdlr)(char *);
	int	flags;
};

struct cvs_resp {
	char	name[32];
	int	supported;

	void	(*hdlr)(char *);
	int	flags;
};

#define	REQ_NEEDED	0x01
#define RESP_NEEDED	0x01

void	cvs_client_connect_to_server(void);
void	cvs_client_disconnect(void);
void	cvs_client_send_request(char *, ...);
void	cvs_client_read_response(void);
void	cvs_client_get_responses(void);

void	cvs_client_ok(char *);
void	cvs_client_error(char *);
void	cvs_client_validreq(char *);
void	cvs_client_e(char *);
void	cvs_client_m(char *);
void	cvs_client_checkedin(char *);
void	cvs_client_updated(char *);
void	cvs_client_merged(char *);
void	cvs_client_removed(char *);
void	cvs_client_remove_entry(char *);

void	cvs_client_senddir(const char *);
void	cvs_client_sendfile(struct cvs_file *);
void	cvs_client_send_files(char **, int);

void	cvs_server_root(char *);
void	cvs_server_send_response(char *, ...);
void	cvs_server_validresp(char *);
void	cvs_server_validreq(char *);
void	cvs_server_globalopt(char *);
void	cvs_server_directory(char *);
void	cvs_server_entry(char *);
void	cvs_server_modified(char *);
void	cvs_server_useunchanged(char *);
void	cvs_server_unchanged(char *);
void	cvs_server_questionable(char *);
void	cvs_server_argument(char *);

void	cvs_server_commit(char *);
void	cvs_server_diff(char *);
void	cvs_server_update(char *);
void	cvs_server_status(char *);
void	cvs_server_log(char *);

void	cvs_remote_classify_file(struct cvs_file *);
void	cvs_remote_output(const char *);
char	*cvs_remote_input(void);
BUF	*cvs_remote_receive_file(size_t len);
void	cvs_remote_send_file(const char *);

extern struct cvs_req cvs_requests[];
extern struct cvs_resp cvs_responses[];

struct cvs_req *cvs_remote_get_request_info(const char *);
struct cvs_resp *cvs_remote_get_response_info(const char *);

#endif