Use BBLOCK.
[dragonfly.git] / contrib / cvs-1.12 / src / version.c
blobebce4b2ac0de6ebf95aaf167a36927db47d3f70b
1 /*
2 * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
4 * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
5 * and others.
7 * Portions Copyright (C) 1994 david d `zoo' zuhn
8 * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
9 * Portions Copyright (C) 1989-1992, Brian Berliner
11 * You may distribute under the terms of the GNU General Public License as
12 * specified in the README file that comes with this CVS source distribution.
14 * version.c - the CVS version number
17 #include "cvs.h"
19 #ifdef CLIENT_SUPPORT
20 #ifdef SERVER_SUPPORT
21 char *config_string = " (client/server)\n";
22 #else
23 char *config_string = " (client)\n";
24 #endif
25 #else
26 #ifdef SERVER_SUPPORT
27 char *config_string = " (server)\n";
28 #else
29 char *config_string = "\n";
30 #endif
31 #endif
35 static const char *const version_usage[] =
37 "Usage: %s %s\n",
38 NULL
44 * Output a version string for the client and server.
46 * This function will output the simple version number (for the '--version'
47 * option) or the version numbers of the client and server (using the 'version'
48 * command).
50 int
51 version (int argc, char **argv)
53 int err = 0;
55 if (argc == -1)
56 usage (version_usage);
58 if (current_parsed_root && current_parsed_root->isremote)
59 (void) fputs ("Client: ", stdout);
61 /* Having the year here is a good idea, so people have
62 some idea of how long ago their version of CVS was
63 released. */
64 (void) fputs (PACKAGE_STRING, stdout);
65 (void) fputs (config_string, stdout);
67 #ifdef CLIENT_SUPPORT
68 if (current_parsed_root && current_parsed_root->isremote)
70 (void) fputs ("Server: ", stdout);
71 start_server ();
72 if (supported_request ("version"))
73 send_to_server ("version\012", 0);
74 else
76 send_to_server ("noop\012", 0);
77 fputs ("(unknown)\n", stdout);
79 err = get_responses_and_close ();
81 #endif
82 return err;