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