home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / ver_cont / cvs-1.8 / cvs-1 / cvs-1.8.1 / src / client.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-06  |  6.3 KB  |  192 lines

  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 *));
  6.  
  7. extern int gzip_level;
  8. extern int filter_through_gzip PROTO((int, int, int, pid_t *));
  9. extern int filter_through_gunzip PROTO((int, int, pid_t *));
  10.  
  11. #ifdef CLIENT_SUPPORT
  12. /*
  13.  * Functions to perform CVS commands via the protocol.  argc and argv
  14.  * are the arguments and the return value is the exit status (zero success
  15.  * nonzero failure).
  16.  */
  17. extern int client_commit PROTO((int argc, char **argv));
  18. extern int client_update PROTO((int argc, char **argv));
  19. extern int client_checkout PROTO((int argc, char **argv));
  20. extern int client_diff PROTO((int argc, char **argv));
  21. extern int client_log PROTO((int argc, char **argv));
  22. extern int client_add PROTO((int argc, char **argv));
  23. extern int client_remove PROTO((int argc, char **argv));
  24. extern int client_status PROTO((int argc, char **argv));
  25. extern int client_rdiff PROTO((int argc, char **argv));
  26. extern int client_tag PROTO((int argc, char **argv));
  27. extern int client_rtag PROTO((int argc, char **argv));
  28. extern int client_import PROTO((int argc, char **argv));
  29. extern int client_admin PROTO((int argc, char **argv));
  30. extern int client_export PROTO((int argc, char **argv));
  31. extern int client_history PROTO((int argc, char **argv));
  32. extern int client_release PROTO((int argc, char **argv));
  33. extern int client_watch PROTO((int argc, char **argv));
  34. extern int client_watchers PROTO((int argc, char **argv));
  35. extern int client_editors PROTO((int argc, char **argv));
  36. extern int client_edit PROTO((int argc, char **argv));
  37. extern int client_unedit PROTO((int argc, char **argv));
  38. extern int client_init PROTO ((int argc, char **argv));
  39. extern int client_annotate PROTO ((int argc, char **argv));
  40.  
  41. /*
  42.  * Flag variable for seeing whether common code is running as a client
  43.  * or to do a local operation.
  44.  */
  45. extern int client_active;
  46.  
  47. /*
  48.  * Flag variable for seeing whether the server has been started yet.
  49.  * As of this writing, only edit.c:notify_check() uses it.
  50.  */
  51. extern int server_started;
  52.  
  53. /* Is the -P option to checkout or update specified?  */
  54. extern int client_prune_dirs;
  55.  
  56. #ifdef AUTH_CLIENT_SUPPORT
  57. extern int use_authenticating_server;
  58. int connect_to_pserver PROTO((int *tofdp, int* fromfdp, int verify_only));
  59. # ifndef CVS_AUTH_PORT
  60. # define CVS_AUTH_PORT 2401
  61. # endif /* CVS_AUTH_PORT */
  62. #endif /* AUTH_CLIENT_SUPPORT */
  63.  
  64. #ifdef AUTH_SERVER_SUPPORT
  65. extern void authenticate_connection PROTO ((void));
  66. #endif
  67.  
  68. /* Talking to the server. */
  69. void send_to_server PROTO((char *str, size_t len));
  70. void read_from_server PROTO((char *buf, size_t len));
  71.  
  72. /* Internal functions that handle client communication to server, etc.  */
  73. int supported_request PROTO ((char *));
  74. void option_with_arg PROTO((char *option, char *arg));
  75.  
  76. /* Get the responses and then close the connection.  */
  77. extern int get_responses_and_close PROTO((void));
  78.  
  79. extern int get_server_responses PROTO((void));
  80.  
  81. /* Start up the connection to the server on the other end.  */
  82. void
  83. start_server PROTO((void));
  84.  
  85. /* Send the names of all the argument files to the server.  */
  86. void
  87. send_file_names PROTO((int argc, char **argv, unsigned int flags));
  88.  
  89. /* Flags for send_file_names.  */
  90. /* Expand wild cards?  */
  91. #define SEND_EXPAND_WILD 1
  92.  
  93. /*
  94.  * Send Repository, Modified and Entry.  argc and argv contain only
  95.  * the files to operate on (or empty for everything), not options.
  96.  * local is nonzero if we should not recurse (-l option).
  97.  */
  98. void
  99. send_files PROTO((int argc, char **argv, int local, int aflag));
  100.  
  101. /*
  102.  * Like send_files but never send "Unchanged"--just send the contents of the
  103.  * file in that case.  This is used to fix it if you import a directory which
  104.  * happens to have CVS directories (yes it is obscure but the testsuite tests
  105.  * it).
  106.  */
  107. void
  108. send_files_contents PROTO((int argc, char **argv, int local, int aflag));
  109.  
  110. /* Send an argument to the remote server.  */
  111. void
  112. send_arg PROTO((char *string));
  113.  
  114. /* Send a string of single-char options to the remote server, one by one.  */
  115. void
  116. send_option_string PROTO((char *string));
  117.  
  118. #endif /* CLIENT_SUPPORT */
  119.  
  120. /*
  121.  * This structure is used to catalog the responses the client is
  122.  * prepared to see from the server.
  123.  */
  124.  
  125. struct response
  126. {
  127.     /* Name of the response.  */
  128.     char *name;
  129.  
  130. #ifdef CLIENT_SUPPORT
  131.     /*
  132.      * Function to carry out the response.  ARGS is the text of the
  133.      * command after name and, if present, a single space, have been
  134.      * stripped off.  The function can scribble into ARGS if it wants.
  135.      */
  136.     void (*func) PROTO((char *args, int len));
  137.  
  138.     /*
  139.      * ok and error are special; they indicate we are at the end of the
  140.      * responses, and error indicates we should exit with nonzero
  141.      * exitstatus.
  142.      */
  143.     enum {response_type_normal, response_type_ok, response_type_error} type;
  144. #endif
  145.  
  146.     /* Used by the server to indicate whether response is supported by
  147.        the client, as set by the Valid-responses request.  */
  148.     enum {
  149.       /*
  150.        * Failure to implement this response can imply a fatal
  151.        * error.  This should be set only for responses which were in the
  152.        * original version of the protocol; it should not be set for new
  153.        * responses.
  154.        */
  155.       rs_essential,
  156.  
  157.       /* Some clients might not understand this response.  */
  158.       rs_optional,
  159.  
  160.       /*
  161.        * Set by the server to one of the following based on what this
  162.        * client actually supports.
  163.        */
  164.       rs_supported,
  165.       rs_not_supported
  166.       } status;
  167. };
  168.  
  169. /* Table of responses ending in an entry with a NULL name.  */
  170.  
  171. extern struct response responses[];
  172.  
  173. #ifdef CLIENT_SUPPORT
  174.  
  175. extern void client_senddate PROTO((const char *date));
  176. extern void client_expand_modules PROTO((int argc, char **argv, int local));
  177. extern void client_send_expansions PROTO((int local));
  178. extern void client_nonexpanded_setup PROTO((void));
  179.  
  180. extern void send_init_command PROTO ((void));
  181.  
  182. extern char **failed_patches;
  183. extern int failed_patches_count;
  184. extern char toplevel_wd[];
  185. extern void client_import_setup PROTO((char *repository));
  186. extern int client_process_import_file
  187.     PROTO((char *message, char *vfile, char *vtag,
  188.        int targc, char *targv[], char *repository));
  189. extern void client_import_done PROTO((void));
  190. extern void client_notify PROTO((char *, char *, char *, int, char *));
  191. #endif /* CLIENT_SUPPORT */
  192.