[BACK]Return to proto.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/Attic/proto.c between version 1.30 and 1.31

version 1.30, 2004/12/06 21:03:12 version 1.31, 2004/12/07 17:10:56
Line 66 
Line 66 
 #define CVS_REQF_RESP    0x01  #define CVS_REQF_RESP    0x01
   
   
   
   
 extern int   verbosity;  extern int   verbosity;
 extern int   cvs_compress;  extern int   cvs_compress;
 extern char *cvs_rsh;  extern char *cvs_rsh;
Line 76 
Line 74 
 extern int   cvs_readonly;  extern int   cvs_readonly;
 extern int   cvs_cmdop;  extern int   cvs_cmdop;
   
   
   
 static int  cvs_initlog   (void);  static int  cvs_initlog   (void);
   
   
 struct cvs_req cvs_requests[] = {  struct cvs_req cvs_requests[] = {
         { CVS_REQ_DIRECTORY,     "Directory",         0             },          { CVS_REQ_DIRECTORY,     "Directory",         0             },
         { CVS_REQ_MAXDOTDOT,     "Max-dotdot",        0             },          { CVS_REQ_MAXDOTDOT,     "Max-dotdot",        0             },
Line 132 
Line 127 
         { CVS_REQ_CI,            "ci",                CVS_REQF_RESP },          { CVS_REQ_CI,            "ci",                CVS_REQF_RESP },
 };  };
   
   
 struct cvs_resp cvs_responses[] = {  struct cvs_resp cvs_responses[] = {
         { CVS_RESP_OK,         "ok"                     },          { CVS_RESP_OK,         "ok"                     },
         { CVS_RESP_ERROR,      "error"                  },          { CVS_RESP_ERROR,      "error"                  },
Line 167 
Line 161 
 /* hack to receive the remote version without outputting it */  /* hack to receive the remote version without outputting it */
 u_int cvs_version_sent = 0;  u_int cvs_version_sent = 0;
   
   
 static char  cvs_proto_buf[4096];  static char  cvs_proto_buf[4096];
   
 /*  /*
Line 192 
Line 185 
  * server.  Then, a version request is sent and various global flags are sent.   * server.  Then, a version request is sent and various global flags are sent.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_connect(struct cvsroot *root)  cvs_connect(struct cvsroot *root)
 {  {
Line 352 
Line 344 
  *   *
  * Disconnect from the cvs server.   * Disconnect from the cvs server.
  */   */
   
 void  void
 cvs_disconnect(struct cvsroot *root)  cvs_disconnect(struct cvsroot *root)
 {  {
Line 372 
Line 363 
  * cvs_req_getbyid()   * cvs_req_getbyid()
  *   *
  */   */
   
 struct cvs_req*  struct cvs_req*
 cvs_req_getbyid(int reqid)  cvs_req_getbyid(int reqid)
 {  {
Line 381 
Line 371 
         for (i = 0; i < CVS_NBREQ; i++)          for (i = 0; i < CVS_NBREQ; i++)
                 if (cvs_requests[i].req_id == reqid)                  if (cvs_requests[i].req_id == reqid)
                         return &(cvs_requests[i]);                          return &(cvs_requests[i]);
   
         return (NULL);          return (NULL);
 }  }
   
Line 388 
Line 379 
 /*  /*
  * cvs_req_getbyname()   * cvs_req_getbyname()
  */   */
   
 struct cvs_req*  struct cvs_req*
 cvs_req_getbyname(const char *rname)  cvs_req_getbyname(const char *rname)
 {  {
Line 408 
Line 398 
  * Build a space-separated list of all the requests that this protocol   * Build a space-separated list of all the requests that this protocol
  * implementation supports.   * implementation supports.
  */   */
   
 char*  char*
 cvs_req_getvalid(void)  cvs_req_getvalid(void)
 {  {
Line 457 
Line 446 
  * cvs_resp_getbyid()   * cvs_resp_getbyid()
  *   *
  */   */
   
 struct cvs_resp*  struct cvs_resp*
 cvs_resp_getbyid(int respid)  cvs_resp_getbyid(int respid)
 {  {
Line 466 
Line 454 
         for (i = 0; i < CVS_NBREQ; i++)          for (i = 0; i < CVS_NBREQ; i++)
                 if (cvs_responses[i].resp_id == (u_int)respid)                  if (cvs_responses[i].resp_id == (u_int)respid)
                         return &(cvs_responses[i]);                          return &(cvs_responses[i]);
   
         return (NULL);          return (NULL);
 }  }
   
Line 473 
Line 462 
 /*  /*
  * cvs_resp_getbyname()   * cvs_resp_getbyname()
  */   */
   
 struct cvs_resp*  struct cvs_resp*
 cvs_resp_getbyname(const char *rname)  cvs_resp_getbyname(const char *rname)
 {  {
Line 544 
Line 532 
  * Send the mode and size of a file followed by the file's contents.   * Send the mode and size of a file followed by the file's contents.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_sendfile(struct cvsroot *root, const char *path)  cvs_sendfile(struct cvsroot *root, const char *path)
 {  {
Line 594 
Line 581 
  * create or update the file whose path is <path> with the received   * create or update the file whose path is <path> with the received
  * information.   * information.
  */   */
   
 BUF*  BUF*
 cvs_recvfile(struct cvsroot *root, mode_t *mode)  cvs_recvfile(struct cvsroot *root, mode_t *mode)
 {  {
Line 653 
Line 639 
  * contained in <arg>, which should not be terminated by a newline.   * contained in <arg>, which should not be terminated by a newline.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_sendreq(struct cvsroot *root, u_int rid, const char *arg)  cvs_sendreq(struct cvsroot *root, u_int rid, const char *arg)
 {  {
Line 708 
Line 693 
  * non-zero (either an error occured or the end of the response was reached).   * non-zero (either an error occured or the end of the response was reached).
  * Returns the number of handled commands on success, or -1 on failure.   * Returns the number of handled commands on success, or -1 on failure.
  */   */
   
 int  int
 cvs_getresp(struct cvsroot *root)  cvs_getresp(struct cvsroot *root)
 {  {
Line 754 
Line 738 
  * Get a line from the remote end and store it in <lbuf>.  The terminating   * Get a line from the remote end and store it in <lbuf>.  The terminating
  * newline character is stripped from the result.   * newline character is stripped from the result.
  */   */
   
 int  int
 cvs_getln(struct cvsroot *root, char *lbuf, size_t len)  cvs_getln(struct cvsroot *root, char *lbuf, size_t len)
 {  {
Line 794 
Line 777 
  * contained in <arg>, which should not be terminated by a newline.   * contained in <arg>, which should not be terminated by a newline.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_sendresp(u_int rid, const char *arg)  cvs_sendresp(u_int rid, const char *arg)
 {  {
Line 827 
Line 809 
  *   *
  * Get a request from the client.   * Get a request from the client.
  */   */
   
 int  int
 cvs_getreq(void)  cvs_getreq(void)
 {  {
Line 866 
Line 847 
  * without any modifications.   * without any modifications.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 int  int
 cvs_sendln(struct cvsroot *root, const char *line)  cvs_sendln(struct cvsroot *root, const char *line)
 {  {
Line 902 
Line 882 
  *   *
  * Send the first <len> bytes from the buffer <src> to the server.   * Send the first <len> bytes from the buffer <src> to the server.
  */   */
   
 int  int
 cvs_sendraw(struct cvsroot *root, const void *src, size_t len)  cvs_sendraw(struct cvsroot *root, const void *src, size_t len)
 {  {
Line 928 
Line 907 
  *   *
  * Receive the first <len> bytes from the buffer <src> to the server.   * Receive the first <len> bytes from the buffer <src> to the server.
  */   */
   
 ssize_t  ssize_t
 cvs_recvraw(struct cvsroot *root, void *dst, size_t len)  cvs_recvraw(struct cvsroot *root, void *dst, size_t len)
 {  {
Line 954 
Line 932 
  *   *
  * Send a `Directory' request along with the 2 paths that follow it.   * Send a `Directory' request along with the 2 paths that follow it.
  */   */
   
 int  int
 cvs_senddir(struct cvsroot *root, CVSFILE *dir)  cvs_senddir(struct cvsroot *root, CVSFILE *dir)
 {  {
         char lbuf[MAXPATHLEN], rbuf[MAXPATHLEN];          char lbuf[MAXPATHLEN], rbuf[MAXPATHLEN];
   
Line 983 
Line 960 
  * determine if the argument should be simply appended to the last argument   * determine if the argument should be simply appended to the last argument
  * sent or if it should be created as a new argument (0).   * sent or if it should be created as a new argument (0).
  */   */
   
 int  int
 cvs_sendarg(struct cvsroot *root, const char *arg, int append)  cvs_sendarg(struct cvsroot *root, const char *arg, int append)
 {  {
Line 998 
Line 974 
  * Send an `Entry' request to the server along with the mandatory fields from   * Send an `Entry' request to the server along with the mandatory fields from
  * the CVS entry <ent> (which are the name and revision).   * the CVS entry <ent> (which are the name and revision).
  */   */
   
 int  int
 cvs_sendentry(struct cvsroot *root, const struct cvs_ent *ent)  cvs_sendentry(struct cvsroot *root, const struct cvs_ent *ent)
 {  {
Line 1020 
Line 995 
  * output.   * output.
  * Returns 0 on success, or -1 on failure.   * Returns 0 on success, or -1 on failure.
  */   */
   
 static int  static int
 cvs_initlog(void)  cvs_initlog(void)
 {  {

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31