/*
 *  This file is part of DVS, a simple distributed versioning system
 *  See http://www.cs.colorado.edu/~carzanig/dvs/
 *
 *  Author: Antonio Carzaniga <carzanig@cs.colorado.edu>
 *
 *  Copyright (C) 1998-2002 University of Colorado
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA, or send email to carzanig@cs.colorado.edu.
 *
 *
 *  $Id: paths.h,v 1.9 2002/05/01 17:38:47 carzanig Exp $
 */
#ifndef PATHS_H
#define PATHS_H

#include <nc.h>

#ifndef MAXVERSIONLEN
#define MAXVERSIONLEN 8
#endif

/*
 * here the plain version (e.g., strip_version()) returns a const char *
 * that points to a static memory location, the _r version requires the
 * user to provide an output buffer, while the _x version overwrites the 
 * input buffer
 */
extern const char *pathfilename(const char *pathname);
extern char *pathfilename_x(char *pathname);
extern char *pathfilename_r(const char *pathname, char *filename);

extern const char *strip_version(const char *pathname);
extern char *strip_version_x(char *pathname);
extern char *strip_version_r(const char *pathname, char *filename);

extern const char *set_version(const char *pathname, const char *version);
extern char *set_version_x(char *pathname, const char *version);
extern char *set_version_r(const char *pathname, char *filename,
			   const char *version);

extern const char *attach_server(const char *pathname, const t_server *myserv);
extern char *attach_server_x(char *pathname, const t_server *myserv);
extern char *attach_server_r(const char *pathname, char *completepath,
			     const t_server *myserv);

extern int         local_path(const char *pathname);
extern const char *artifactname(const char *pathname);
extern const char *version_position(const char *pathname);
extern char *copy_normalize_path(char *target, const char *source);
extern char *copy_dirname_filename(char *dirname, char *filename, 
				   const char *path);

#endif
