1 /* Interface between the client and the rest of CVS. */
3 /* Stuff shared with the server. */
4 extern char *mode_to_string (mode_t);
5 extern int change_mode (char *, char *, int);
8 extern int file_gzip_level;
12 void make_bufs_from_fds ( int, int, int,
18 #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
20 /* Whether the connection should be encrypted. */
21 extern int cvsencrypt;
23 /* Whether the connection should use per-packet authentication. */
24 extern int cvsauthenticate;
30 /* We can't declare the arguments without including krb.h, and I don't
31 want to do that in every file. */
32 extern struct buffer *krb_encrypt_buffer_initialize ();
34 # endif /* HAVE_KERBEROS */
36 # endif /* ENCRYPTION */
38 #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
42 * Flag variable for seeing whether the server has been started yet.
43 * As of this writing, only edit.c:notify_check() uses it.
45 extern int server_started;
47 /* Is the -P option to checkout or update specified? */
48 extern int client_prune_dirs;
50 # ifdef AUTH_CLIENT_SUPPORT
51 extern int use_authenticating_server;
52 # endif /* AUTH_CLIENT_SUPPORT */
53 # if defined (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI)
54 void connect_to_pserver (cvsroot_t *, struct buffer **, struct buffer **,
56 # ifndef CVS_AUTH_PORT
57 # define CVS_AUTH_PORT 2401
58 # endif /* CVS_AUTH_PORT */
59 # ifndef CVS_PROXY_PORT
60 # define CVS_PROXY_PORT 8080
61 # endif /* CVS_AUTH_PORT */
62 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
66 # define CVS_PORT 1999
68 # endif /* HAVE_KERBEROS */
70 /* Talking to the server. */
71 void send_to_server (const char *str, size_t len);
72 void read_from_server (char *buf, size_t len);
74 /* Internal functions that handle client communication to server, etc. */
75 int supported_request (char *);
76 void option_with_arg (char *option, char *arg);
78 /* Get the responses and then close the connection. */
79 extern int get_responses_and_close (void);
81 extern int get_server_responses (void);
83 /* Start up the connection to the server on the other end. */
87 /* Send the names of all the argument files to the server. */
89 send_file_names (int argc, char **argv, unsigned int flags);
91 /* Flags for send_file_names. */
92 /* Expand wild cards? */
93 # define SEND_EXPAND_WILD 1
96 * Send Repository, Modified and Entry. argc and argv contain only
97 * the files to operate on (or empty for everything), not options.
98 * local is nonzero if we should not recurse (-l option).
101 send_files (int argc, char **argv, int local, int aflag,
104 /* Flags for send_files. */
105 # define SEND_BUILD_DIRS 1
106 # define SEND_FORCE 2
107 # define SEND_NO_CONTENTS 4
108 # define BACKUP_MODIFIED_FILES 8
110 /* Send an argument to the remote server. */
112 send_arg (char *string);
114 /* Send a string of single-char options to the remote server, one by one. */
116 send_option_string (char *string);
118 extern void send_a_repository (const char *, const char *, const char *);
120 #endif /* CLIENT_SUPPORT */
123 * This structure is used to catalog the responses the client is
124 * prepared to see from the server.
129 /* Name of the response. */
132 #ifdef CLIENT_SUPPORT
134 * Function to carry out the response. ARGS is the text of the
135 * command after name and, if present, a single space, have been
136 * stripped off. The function can scribble into ARGS if it wants.
137 * Note that although LEN is given, ARGS is also guaranteed to be
140 void (*func) (char *args, int len);
143 * ok and error are special; they indicate we are at the end of the
144 * responses, and error indicates we should exit with nonzero
147 enum {response_type_normal, response_type_ok, response_type_error} type;
150 /* Used by the server to indicate whether response is supported by
151 the client, as set by the Valid-responses request. */
154 * Failure to implement this response can imply a fatal
155 * error. This should be set only for responses which were in the
156 * original version of the protocol; it should not be set for new
161 /* Some clients might not understand this response. */
165 * Set by the server to one of the following based on what this
166 * client actually supports.
173 /* Table of responses ending in an entry with a NULL name. */
175 extern struct response responses[];
177 #ifdef CLIENT_SUPPORT
179 extern void client_senddate (const char *date);
180 extern void client_expand_modules (int argc, char **argv, int local);
181 extern void client_send_expansions (int local, char *where,
183 extern void client_nonexpanded_setup (void);
185 extern void send_init_command (void);
187 extern char **failed_patches;
188 extern int failed_patches_count;
189 extern char *toplevel_wd;
190 extern void client_import_setup (char *repository);
191 extern int client_process_import_file
192 (char *message, char *vfile, char *vtag, int targc, char *targv[],
193 char *repository, int all_files_binary, int modtime);
194 extern void client_import_done (void);
195 extern void client_notify (const char *, const char *, const char *, int,
197 #endif /* CLIENT_SUPPORT */