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