186d7f5d3SJohn Marino /* 286d7f5d3SJohn Marino * Copyright (C) 1986-2005 The Free Software Foundation, Inc. 386d7f5d3SJohn Marino * 486d7f5d3SJohn Marino * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>, 586d7f5d3SJohn Marino * and others. 686d7f5d3SJohn Marino * 786d7f5d3SJohn Marino * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk 886d7f5d3SJohn Marino * Portions Copyright (C) 1989-1992, Brian Berliner 986d7f5d3SJohn Marino * 1086d7f5d3SJohn Marino * You may distribute under the terms of the GNU General Public License as 1186d7f5d3SJohn Marino * specified in the README file that comes with the CVS kit. 1286d7f5d3SJohn Marino */ 1386d7f5d3SJohn Marino 1486d7f5d3SJohn Marino /* CVSroot data structures */ 1586d7f5d3SJohn Marino 1686d7f5d3SJohn Marino /* Access method specified in CVSroot. */ 1786d7f5d3SJohn Marino typedef enum { 1886d7f5d3SJohn Marino null_method = 0, 1986d7f5d3SJohn Marino local_method, 2086d7f5d3SJohn Marino server_method, 2186d7f5d3SJohn Marino pserver_method, 2286d7f5d3SJohn Marino kserver_method, 2386d7f5d3SJohn Marino gserver_method, 2486d7f5d3SJohn Marino ext_method, 2586d7f5d3SJohn Marino fork_method 2686d7f5d3SJohn Marino } CVSmethod; 2786d7f5d3SJohn Marino extern const char method_names[][16]; /* change this in root.c if you change 2886d7f5d3SJohn Marino the enum above */ 2986d7f5d3SJohn Marino 3086d7f5d3SJohn Marino typedef struct cvsroot_s { 3186d7f5d3SJohn Marino char *original; /* The complete source CVSroot string. */ 3286d7f5d3SJohn Marino CVSmethod method; /* One of the enum values above. */ 3386d7f5d3SJohn Marino char *directory; /* The directory name. */ 3486d7f5d3SJohn Marino bool isremote; /* True if we are doing remote access. */ 3586d7f5d3SJohn Marino /* The following is required for servers now to allow Redirects to be sent 3686d7f5d3SJohn Marino * for remote roots when client support is disabled. 3786d7f5d3SJohn Marino */ 3886d7f5d3SJohn Marino #if defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) 3986d7f5d3SJohn Marino char *username; /* The username or NULL if method == local. */ 4086d7f5d3SJohn Marino char *password; /* The password or NULL if method == local. */ 4186d7f5d3SJohn Marino char *hostname; /* The hostname or NULL if method == local. */ 4286d7f5d3SJohn Marino char *cvs_rsh; /* The $CVS_RSH or NULL if method != ext. */ 4386d7f5d3SJohn Marino char *cvs_server; /* The $CVS_SERVER or NULL if 4486d7f5d3SJohn Marino * method != ext and method != fork. */ 4586d7f5d3SJohn Marino int port; /* The port or zero if method == local. */ 4686d7f5d3SJohn Marino char *proxy_hostname; /* The hostname of the proxy server, or NULL 4786d7f5d3SJohn Marino * when method == local or no proxy will be 4886d7f5d3SJohn Marino * used. 4986d7f5d3SJohn Marino */ 5086d7f5d3SJohn Marino int proxy_port; /* The port of the proxy or zero, as above. */ 5186d7f5d3SJohn Marino bool redirect; /* False if we are to disable redirects. */ 5286d7f5d3SJohn Marino #endif /* defined (CLIENT_SUPPORT) || defined (SERVER_SUPPORT) */ 5386d7f5d3SJohn Marino } cvsroot_t; 5486d7f5d3SJohn Marino 5586d7f5d3SJohn Marino extern cvsroot_t *current_parsed_root; 5686d7f5d3SJohn Marino extern const cvsroot_t *original_parsed_root; 5786d7f5d3SJohn Marino 5886d7f5d3SJohn Marino cvsroot_t *Name_Root (const char *dir, const char *update_dir); 5986d7f5d3SJohn Marino cvsroot_t *parse_cvsroot (const char *root) 6086d7f5d3SJohn Marino __attribute__ ((__malloc__)); 6186d7f5d3SJohn Marino cvsroot_t *local_cvsroot (const char *dir) 6286d7f5d3SJohn Marino __attribute__ ((__malloc__)); 6386d7f5d3SJohn Marino void Create_Root (const char *dir, const char *rootdir); 6486d7f5d3SJohn Marino void root_allow_add (const char *, const char *configPath); 6586d7f5d3SJohn Marino void root_allow_free (void); 6686d7f5d3SJohn Marino bool root_allow_ok (const char *); 6786d7f5d3SJohn Marino struct config *get_root_allow_config (const char *arg, const char *configPath); 6886d7f5d3SJohn Marino const char *primary_root_translate (const char *root_in); 6986d7f5d3SJohn Marino const char *primary_root_inverse_translate (const char *root_in); 70