1 /* Interface between the client and the rest of CVS. */
3 /* Stuff shared with the server. */
4 char *mode_to_string (mode_t);
5 int change_mode (const char *, const char *, int);
8 extern int file_gzip_level;
12 void make_bufs_from_fds (int, int, int, cvsroot_t *,
13 struct buffer **, struct buffer **, int);
16 #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
18 /* Whether the connection should be encrypted. */
19 extern int cvsencrypt;
21 /* Whether the connection should use per-packet authentication. */
22 extern int cvsauthenticate;
28 /* We can't declare the arguments without including krb.h, and I don't
29 want to do that in every file. */
30 extern struct buffer *krb_encrypt_buffer_initialize ();
32 # endif /* HAVE_KERBEROS */
34 # endif /* ENCRYPTION */
36 #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
40 * Flag variable for seeing whether the server has been started yet.
41 * As of this writing, only edit.c:notify_check() uses it.
43 extern int server_started;
45 /* Is the -P option to checkout or update specified? */
46 extern int client_prune_dirs;
48 # ifdef AUTH_CLIENT_SUPPORT
49 extern int use_authenticating_server;
50 # endif /* AUTH_CLIENT_SUPPORT */
51 # if defined (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI)
52 void connect_to_pserver (cvsroot_t *, struct buffer **, struct buffer **,
54 # ifndef CVS_AUTH_PORT
55 # define CVS_AUTH_PORT 2401
56 # endif /* CVS_AUTH_PORT */
57 # ifndef CVS_PROXY_PORT
58 # define CVS_PROXY_PORT 8080
59 # endif /* CVS_AUTH_PORT */
60 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
64 # define CVS_PORT 1999
66 # endif /* HAVE_KERBEROS */
68 /* Talking to the server. */
69 void send_to_server (const char *str, size_t len);
70 void read_from_server (char *buf, size_t len);
72 /* Internal functions that handle client communication to server, etc. */
73 bool supported_request (const char *);
74 void option_with_arg (const char *option, const char *arg);
76 /* Get the responses and then close the connection. */
77 int get_responses_and_close (void);
79 int get_server_responses (void);
81 /* Start up the connection to the server on the other end. */
83 open_connection_to_server (cvsroot_t *root, struct buffer **to_server_p,
84 struct buffer **from_server_p);
88 /* Send the names of all the argument files to the server. */
90 send_file_names (int argc, char **argv, unsigned int flags);
92 /* Flags for send_file_names. */
93 /* Expand wild cards? */
94 # define SEND_EXPAND_WILD 1
97 * Send Repository, Modified and Entry. argc and argv contain only
98 * the files to operate on (or empty for everything), not options.
99 * local is nonzero if we should not recurse (-l option).
102 send_files (int argc, char **argv, int local, int aflag,
105 /* Flags for send_files. */
106 # define SEND_BUILD_DIRS 1
107 # define SEND_FORCE 2
108 # define SEND_NO_CONTENTS 4
109 # define BACKUP_MODIFIED_FILES 8
111 /* Send an argument to the remote server. */
113 send_arg (const char *string);
115 /* Send a string of single-char options to the remote server, one by one. */
117 send_option_string (const char *string);
119 void send_a_repository (const char *, const char *, const char *);
121 #endif /* CLIENT_SUPPORT */
124 * This structure is used to catalog the responses the client is
125 * prepared to see from the server.
130 /* Name of the response. */
133 #ifdef CLIENT_SUPPORT
135 * Function to carry out the response. ARGS is the text of the
136 * command after name and, if present, a single space, have been
137 * stripped off. The function can scribble into ARGS if it wants.
138 * Note that although LEN is given, ARGS is also guaranteed to be
141 void (*func) (char *args, size_t len);
144 * ok and error are special; they indicate we are at the end of the
145 * responses, and error indicates we should exit with nonzero
148 enum {response_type_normal, response_type_ok, response_type_error,
149 response_type_redirect} type;
152 /* Used by the server to indicate whether response is supported by
153 the client, as set by the Valid-responses request. */
156 * Failure to implement this response can imply a fatal
157 * error. This should be set only for responses which were in the
158 * original version of the protocol; it should not be set for new
163 /* Some clients might not understand this response. */
167 * Set by the server to one of the following based on what this
168 * client actually supports.
175 /* Table of responses ending in an entry with a NULL name. */
177 extern struct response responses[];
179 #ifdef CLIENT_SUPPORT
181 void client_senddate (const char *date);
182 void client_expand_modules (int argc, char **argv, int local);
183 void client_send_expansions (int local, char *where, int build_dirs);
184 void client_nonexpanded_setup (void);
186 void send_init_command (void);
188 extern char **failed_patches;
189 extern int failed_patches_count;
190 extern char *toplevel_wd;
191 void client_import_setup (char *repository);
192 int client_process_import_file
193 (char *message, char *vfile, char *vtag, int targc, char *targv[],
194 char *repository, int all_files_binary, int modtime);
195 void client_import_done (void);
196 void client_notify (const char *, const char *, const char *, int,
198 #endif /* CLIENT_SUPPORT */