6 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
7 * Copyright (C) 2009, MinGW Project
10 * Helper function for constructing path names to the XML data files
11 * specifying the mingw-get configuration, and installation manifest.
14 * This is free software. Permission is granted to copy, modify and
15 * redistribute this software, under the provisions of the GNU General
16 * Public License, Version 3, (or, at your option, any later version),
17 * as published by the Free Software Foundation; see the file COPYING
18 * for licensing details.
20 * Note, in particular, that this software is provided "as is", in the
21 * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
22 * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
23 * PARTICULAR PURPOSE. Under no circumstances will the author, or the
24 * MinGW Project, accept liability for any damages, however caused,
25 * arising from the use of this software.
32 const char *xmlfile( const char *name, const char *modifier )
34 /* Construct a full path name for the file specified by "name",
35 * adding the mandatory ".xml" extension; the path is always based
36 * at "${APPROOT}", with "modifier" specifying an optional subdirectory
37 * of the standard path, (typically used as a temporary location for
38 * internet downloads while in transit).
40 const char *datapath = "%R" "var/lib/mingw-get/data" "%/M/%F.xml";
41 char *datafile = (char *)(malloc( mkpath( NULL, datapath, name, modifier ) ));
43 mkpath( datafile, datapath, name, modifier );
44 return (const char *)(datafile);
47 /* $RCSfile$: end of file */