]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/cvs/src/client.h
This commit was generated by cvs2svn to compensate for changes in r169942,
[FreeBSD/FreeBSD.git] / contrib / cvs / src / client.h
1 /* Interface between the client and the rest of CVS.  */
2
3 /* Stuff shared with the server.  */
4 extern char *mode_to_string PROTO((mode_t));
5 extern int change_mode PROTO((char *, char *, int));
6
7 extern int gzip_level;
8 extern int file_gzip_level;
9
10 #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
11
12 /* Whether the connection should be encrypted.  */
13 extern int cvsencrypt;
14
15 /* Whether the connection should use per-packet authentication.  */
16 extern int cvsauthenticate;
17
18 #ifdef __STDC__
19 struct buffer;
20 #endif
21
22 # ifdef ENCRYPTION
23
24 #   ifdef HAVE_KERBEROS
25
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 ();
29
30 #   endif /* HAVE_KERBEROS */
31
32 #   ifdef HAVE_GSSAPI
33
34 /* Set this to turn on GSSAPI encryption.  */
35 extern int cvs_gssapi_encrypt;
36
37 #   endif /* HAVE_GSSAPI */
38
39 # endif /* ENCRYPTION */
40
41 # ifdef HAVE_GSSAPI
42
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 ();
46
47 # endif /* HAVE_GSSAPI */
48
49 #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
50
51 #ifdef CLIENT_SUPPORT
52 /*
53  * Flag variable for seeing whether the server has been started yet.
54  * As of this writing, only edit.c:notify_check() uses it.
55  */
56 extern int server_started;
57
58 /* Is the -P option to checkout or update specified?  */
59 extern int client_prune_dirs;
60
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 *,
66                                 struct buffer **,
67                                 struct buffer **,
68                                 int, int ));
69 #   ifndef CVS_AUTH_PORT
70 #     define CVS_AUTH_PORT 2401
71 #   endif /* CVS_AUTH_PORT */
72 # endif /* (AUTH_CLIENT_SUPPORT) || defined (HAVE_GSSAPI) */
73
74 # if HAVE_KERBEROS
75 #   ifndef CVS_PORT
76 #     define CVS_PORT 1999
77 #   endif
78 # endif /* HAVE_KERBEROS */
79
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));
83
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));
87
88 /* Get the responses and then close the connection.  */
89 extern int get_responses_and_close PROTO((void));
90
91 extern int get_server_responses PROTO((void));
92
93 /* Start up the connection to the server on the other end.  */
94 void
95 start_server PROTO((void));
96
97 /* Send the names of all the argument files to the server.  */
98 void
99 send_file_names PROTO((int argc, char **argv, unsigned int flags));
100
101 /* Flags for send_file_names.  */
102 /* Expand wild cards?  */
103 # define SEND_EXPAND_WILD 1
104
105 /*
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).
109  */
110 void
111 send_files PROTO((int argc, char **argv, int local, int aflag,
112                   unsigned int flags));
113
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
119
120 /* Send an argument to the remote server.  */
121 void
122 send_arg PROTO((char *string));
123
124 /* Send a string of single-char options to the remote server, one by one.  */
125 void
126 send_option_string PROTO((char *string));
127
128 extern void send_a_repository PROTO ((const char *, const char *,
129                                       const char *));
130
131 #endif /* CLIENT_SUPPORT */
132 \f
133 /*
134  * This structure is used to catalog the responses the client is
135  * prepared to see from the server.
136  */
137
138 struct response
139 {
140     /* Name of the response.  */
141     char *name;
142
143 #ifdef CLIENT_SUPPORT
144     /*
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
149      * '\0' terminated.
150      */
151     void (*func) PROTO((char *args, int len));
152
153     /*
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
156      * exitstatus.
157      */
158     enum {response_type_normal, response_type_ok, response_type_error} type;
159 #endif
160
161     /* Used by the server to indicate whether response is supported by
162        the client, as set by the Valid-responses request.  */
163     enum {
164       /*
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
168        * responses.
169        */
170       rs_essential,
171
172       /* Some clients might not understand this response.  */
173       rs_optional,
174
175       /*
176        * Set by the server to one of the following based on what this
177        * client actually supports.
178        */
179       rs_supported,
180       rs_not_supported
181       } status;
182 };
183
184 /* Table of responses ending in an entry with a NULL name.  */
185
186 extern struct response responses[];
187
188 #ifdef CLIENT_SUPPORT
189
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,
193                                           int build_dirs));
194 extern void client_nonexpanded_setup PROTO((void));
195
196 extern void send_init_command PROTO ((void));
197 \f
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,
205            int modtime));
206 extern void client_import_done PROTO((void));
207 extern void client_notify PROTO((const char *, const char *, const char *, int,
208                                  const char *));
209 #endif /* CLIENT_SUPPORT */