GrafX2 2.9.3227
The ultimate 256-color painting program
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <FindDirectory.h>
#include "haiku.h"
#include "struct.h"
#include "io.h"
#include "setup.h"
#include "global.h"
#include "gfx2log.h"
Macros | |
#define | PATH_MAX 32768 |
Functions | |
char * | Get_program_directory (const char *argv0) |
Determine which directory contains the executable. More... | |
char * | Get_data_directory (const char *program_dir) |
Determine which directory contains the read-only data. More... | |
char * | Get_config_directory (const char *program_dir) |
Determine which directory should store the user's configuration. More... | |
#define PATH_MAX 32768 |
char * Get_program_directory | ( | const char * | argv0 | ) |
Determine which directory contains the executable.
argv0 | Main's argv[0], some platforms need it, some don't. |
References Extract_path(), Get_current_directory(), GFX2_DEBUG, GFX2_Log(), GFX2_WARNING, haiku_get_app_path(), MAX_PATH_CHARACTERS, NULL, PATH_MAX, and PATH_SEPARATOR.
Referenced by Init_program().
char * Get_data_directory | ( | const char * | program_dir | ) |
Determine which directory contains the read-only data.
program_dir | The directory containing the executable |
References Filepath_append_to_dir(), Get_data_directory(), and PATH_MAX.
Referenced by Get_data_directory(), and Init_program().
char * Get_config_directory | ( | const char * | program_dir | ) |
Determine which directory should store the user's configuration.
For most Unix and Windows platforms: If a config file already exists in program_dir, it will return it in priority (Useful for development, and possibly for upgrading from DOS version) If the standard directory doesn't exist yet, this function will attempt to create it (/root/.grafx2, or APPDATA%\GrafX2) If it cannot be created, this function will return the executable's own directory.
program_dir | The directory containing the executable |
References CONFIG_FILENAME, Directory_create(), Directory_exists(), File_exists(), Filepath_append_to_dir(), GFX2_INFO, GFX2_Log(), GFX2_WARNING, MAX_PATH_CHARACTERS, PATH_SEPARATOR, and Portable_Installation_Detected.
Referenced by Init_program().