1 /* 2 * TilEm II 3 * 4 * Copyright (c) 2011 Benjamin Moody 5 * 6 * This program is free software: you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation, either version 3 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 /* Set the name used to invoke this program. Data files can be 21 located relative to this path if the package is not installed */ 22 void set_program_path(const char *path); 23 24 /* Locate an existing configuration or data file. Arguments will be 25 concatenated, separated by / or \, as with g_build_filename(). 26 NULL is returned if the file isn't found. Free result with 27 g_free(). */ 28 char * get_shared_file_path(const char *name, ...) 29 G_GNUC_NULL_TERMINATED; 30 31 /* Locate an existing configuration or data directory. NULL is 32 returned if the file isn't found. Free result with g_free(). */ 33 char * get_shared_dir_path(const char *name, ...) 34 G_GNUC_NULL_TERMINATED; 35 36 /* Get the full path where a configuration file should be written; 37 attempt to create the directory if it doesn't exist. This function 38 will always return a valid filename (although it may not actually 39 be writable.) Free result with g_free(). */ 40 char * get_config_file_path(const char *name, ...) 41 G_GNUC_NULL_TERMINATED; 42 43