1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
.TH al_get_standard_path 3 "" "Allegro reference manual"
.SH NAME
.PP
al_get_standard_path \- Allegro 5 API
.SH SYNOPSIS
.IP
.nf
\f[C]
#include\ <allegro5/allegro.h>
ALLEGRO_PATH\ *al_get_standard_path(int\ id)
\f[]
.fi
.SH DESCRIPTION
.PP
Gets a system path, depending on the \f[C]id\f[] parameter.
Some of these paths may be affected by the organization and application
name, so be sure to set those before calling this function.
.PP
The paths are not guaranteed to be unique (e.g., SETTINGS and DATA may
be the same on some platforms), so you should be sure your filenames are
unique if you need to avoid naming collisions.
Also, a returned path may not actually exist on the file system.
.TP
.B ALLEGRO_RESOURCES_PATH
If you bundle data in a location relative to your executable, then you
should use this path to locate that data.
On most platforms, this is the directory that contains the executable
file.
.RS
.PP
If ran from an OS X app bundle, then this will point to the internal
resource directory (/Contents/Resources).
To maintain consistency, if you put your resources into a directory
called "data" beneath the executable on some other platform (like
Windows), then you should also create a directory called "data" under
the OS X app bundle\[aq]s resource folder.
.PP
You should not try to write to this path, as it is very likely
read\-only.
.PP
If you install your resources in some other system directory (e.g., in
/usr/share or C:\\ProgramData), then you are responsible for keeping
track of that yourself.
.RE
.TP
.B ALLEGRO_TEMP_PATH
Path to the directory for temporary files.
.RS
.RE
.TP
.B ALLEGRO_USER_HOME_PATH
This is the user\[aq]s home directory.
You should not normally write files into this directory directly, or
create any sub folders in it, without explicit permission from the user.
One practical application of this path would be to use it as the
starting place of a file selector in a GUI.
.RS
.RE
.TP
.B ALLEGRO_USER_DOCUMENTS_PATH
This location is easily accessible by the user, and is the place to
store documents and files that the user might want to later open with an
external program or transfer to another place.
.RS
.PP
You should not save files here unless the user expects it, usually by
explicit permission.
.RE
.TP
.B ALLEGRO_USER_DATA_PATH
If your program saves any data that the user doesn\[aq]t need to access
externally, then you should place it here.
This is generally the least intrusive place to store data.
.RS
.RE
.TP
.B ALLEGRO_USER_SETTINGS_PATH
If you are saving configuration files (especially if the user may want
to edit them outside of your program), then you should place them here.
.RS
.RE
.TP
.B ALLEGRO_EXENAME_PATH
The full path to the executable.
.RS
.RE
.PP
Returns NULL on failure.
The returned path should be freed with al_destroy_path(3).
.SH SEE ALSO
.PP
al_set_app_name(3), al_set_org_name(3), al_destroy_path(3),
al_set_exe_name(3)
|