xref: /dragonfly/contrib/cvs-1.12/src/root.h (revision a563ca70)
1 /*
2  * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
3  *
4  * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
5  *                                  and others.
6  *
7  * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
8  * Portions Copyright (C) 1989-1992, Brian Berliner
9  *
10  * You may distribute under the terms of the GNU General Public License as
11  * specified in the README file that comes with the CVS kit.
12  */
13 
14 /* CVSroot data structures */
15 
16 /* Access method specified in CVSroot. */
17 typedef enum {
18     null_method = 0,
19     local_method,
20     server_method,
21     pserver_method,
22     kserver_method,
23     gserver_method,
24     ext_method,
25     fork_method
26 } CVSmethod;
27 extern const char method_names[][16];	/* change this in root.c if you change
28 					   the enum above */
29 
30 typedef struct cvsroot_s {
31     char *original;		/* The complete source CVSroot string. */
32     CVSmethod method;		/* One of the enum values above. */
33     char *directory;		/* The directory name. */
34     bool isremote;		/* True if we are doing remote access. */
35 /* The following is required for servers now to allow Redirects to be sent
36  * for remote roots when client support is disabled.
37  */
38 #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT)
39     char *username;		/* The username or NULL if method == local. */
40     char *password;		/* The password or NULL if method == local. */
41     char *hostname;		/* The hostname or NULL if method == local. */
42     char *cvs_rsh;		/* The $CVS_RSH or NULL if method != ext. */
43     char *cvs_server;		/* The $CVS_SERVER or NULL if
44 				 * method != ext and method != fork. */
45     int port;			/* The port or zero if method == local. */
46     char *proxy_hostname;	/* The hostname of the proxy server, or NULL
47 				 * when method == local or no proxy will be
48 				 * used.
49 				 */
50     int proxy_port;		/* The port of the proxy or zero, as above. */
51     bool redirect;		/* False if we are to disable redirects. */
52 #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */
53 } cvsroot_t;
54 
55 extern cvsroot_t *current_parsed_root;
56 extern const cvsroot_t *original_parsed_root;
57 
58 cvsroot_t *Name_Root (const char *dir, const char *update_dir);
59 cvsroot_t *parse_cvsroot (const char *root)
60 	__attribute__ ((__malloc__));
61 cvsroot_t *local_cvsroot (const char *dir)
62 	__attribute__ ((__malloc__));
63 void Create_Root (const char *dir, const char *rootdir);
64 void root_allow_add (const char *, const char *configPath);
65 void root_allow_free (void);
66 bool root_allow_ok (const char *);
67 struct config *get_root_allow_config (const char *arg, const char *configPath);
68 const char *primary_root_translate (const char *root_in);
69 const char *primary_root_inverse_translate (const char *root_in);
70