1 /* Interface between the client and the rest of CVS. */
3 /* Stuff shared with the server. */
4 extern char *mode_to_string PROTO((mode_t));
5 extern int change_mode PROTO((char *, char *, int));
8 extern int file_gzip_level;
10 #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
12 /* Whether the connection should be encrypted. */
13 extern int cvsencrypt;
15 /* Whether the connection should use per-packet authentication. */
16 extern int cvsauthenticate;
26 /* We can't declare the arguments without including krb.h, and I don't
27 want to do that in every file. */
28 extern struct buffer *krb_encrypt_buffer_initialize ();
30 # endif /* HAVE_KERBEROS */
34 /* Set this to turn on GSSAPI encryption. */
35 extern int cvs_gssapi_encrypt;
37 # endif /* HAVE_GSSAPI */
39 # endif /* ENCRYPTION */
43 /* We can't declare the arguments without including gssapi.h, and I
44 don't want to do that in every file. */
45 extern struct buffer *cvs_gssapi_wrap_buffer_initialize ();
47 # endif /* HAVE_GSSAPI */
49 #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
53 * Flag variable for seeing whether the server has been started yet.
54 * As of this writing, only edit.c:notify_check() uses it.
56 extern int server_started;
58 /* Is the -P option to checkout or update specified? */
59 extern int client_prune_dirs;
61 # ifdef AUTH_CLIENT_SUPPORT
62 extern int use_authenticating_server;
63 # endif /* AUTH_CLIENT_SUPPORT */
64 # if defined (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI)
65 void connect_to_pserver PROTO ((cvsroot_t *,
69 # ifndef CVS_AUTH_PORT
70 # define CVS_AUTH_PORT 2401
71 # endif /* CVS_AUTH_PORT */
72 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
76 # define CVS_PORT 1999
78 # endif /* HAVE_KERBEROS */
80 /* Talking to the server. */
81 void send_to_server PROTO((const char *str, size_t len));
82 void read_from_server PROTO((char *buf, size_t len));
84 /* Internal functions that handle client communication to server, etc. */
85 int supported_request PROTO ((char *));
86 void option_with_arg PROTO((char *option, char *arg));
88 /* Get the responses and then close the connection. */
89 extern int get_responses_and_close PROTO((void));
91 extern int get_server_responses PROTO((void));
93 /* Start up the connection to the server on the other end. */
95 start_server PROTO((void));
97 /* Send the names of all the argument files to the server. */
99 send_file_names PROTO((int argc, char **argv, unsigned int flags));
101 /* Flags for send_file_names. */
102 /* Expand wild cards? */
103 # define SEND_EXPAND_WILD 1
106 * Send Repository, Modified and Entry. argc and argv contain only
107 * the files to operate on (or empty for everything), not options.
108 * local is nonzero if we should not recurse (-l option).
111 send_files PROTO((int argc, char **argv, int local, int aflag,
112 unsigned int flags));
114 /* Flags for send_files. */
115 # define SEND_BUILD_DIRS 1
116 # define SEND_FORCE 2
117 # define SEND_NO_CONTENTS 4
118 # define BACKUP_MODIFIED_FILES 8
120 /* Send an argument to the remote server. */
122 send_arg PROTO((char *string));
124 /* Send a string of single-char options to the remote server, one by one. */
126 send_option_string PROTO((char *string));
128 extern void send_a_repository PROTO ((const char *, const char *,
131 #endif /* CLIENT_SUPPORT */
134 * This structure is used to catalog the responses the client is
135 * prepared to see from the server.
140 /* Name of the response. */
143 #ifdef CLIENT_SUPPORT
145 * Function to carry out the response. ARGS is the text of the
146 * command after name and, if present, a single space, have been
147 * stripped off. The function can scribble into ARGS if it wants.
148 * Note that although LEN is given, ARGS is also guaranteed to be
151 void (*func) PROTO((char *args, int len));
154 * ok and error are special; they indicate we are at the end of the
155 * responses, and error indicates we should exit with nonzero
158 enum {response_type_normal, response_type_ok, response_type_error} type;
161 /* Used by the server to indicate whether response is supported by
162 the client, as set by the Valid-responses request. */
165 * Failure to implement this response can imply a fatal
166 * error. This should be set only for responses which were in the
167 * original version of the protocol; it should not be set for new
172 /* Some clients might not understand this response. */
176 * Set by the server to one of the following based on what this
177 * client actually supports.
184 /* Table of responses ending in an entry with a NULL name. */
186 extern struct response responses[];
188 #ifdef CLIENT_SUPPORT
190 extern void client_senddate PROTO((const char *date));
191 extern void client_expand_modules PROTO((int argc, char **argv, int local));
192 extern void client_send_expansions PROTO((int local, char *where,
194 extern void client_nonexpanded_setup PROTO((void));
196 extern void send_init_command PROTO ((void));
198 extern char **failed_patches;
199 extern int failed_patches_count;
200 extern char *toplevel_wd;
201 extern void client_import_setup PROTO((char *repository));
202 extern int client_process_import_file
203 PROTO((char *message, char *vfile, char *vtag,
204 int targc, char *targv[], char *repository, int all_files_binary,
206 extern void client_import_done PROTO((void));
207 extern void client_notify PROTO((const char *, const char *, const char *, int,
209 #endif /* CLIENT_SUPPORT */