al_get_standard_path(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– al_get_standard_path(3) πŸ’–

okay bestie, this one is straight from the Library Functions Manual, and it’s the Allegro 5 API page for getting standard system paths. slay.

πŸŽ€ NAME πŸŽ€

al_get_standard_path β€” Allegro 5 API.

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

ALLEGRO_PATH *al_get_standard_path(int id)

πŸ¦‹ DESCRIPTION πŸ¦‹

Gets a system path, depending on the id parameter. Some of these paths may be affected by the organization and application name, so be sure to set those before calling this function. no cap.

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. vibe check: check before you assume, bestie.

  • 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.

If called from an OS X app bundle, then this will point to the internal resource directory (<bundle.app>/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’s resource folder.

⚠️ You should not try to write to this path, as it is very likely read-only. periodt.

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.

  • ALLEGRO_TEMP_PATH β€” path to the directory for temporary files. 🧚
  • ALLEGRO_USER_HOME_PATH β€” this is the user’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.
  • 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.

You should not save files here unless the user expects it, usually by explicit permission. 🫢

  • ALLEGRO_USER_DATA_PATH β€” if your program saves any data that the user doesn’t need to access externally, then you should place it here. This is generally the least intrusive place to store data. This path will usually not be present on the file system, so make sure to create it before writing to it. πŸ’…
  • 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. This path will usually not be present on the file system, so make sure to create it before writing to it. ✨
  • ALLEGRO_EXENAME_PATH β€” the full path to the executable. πŸ‘‘

Returns NULL on failure. The returned path should be freed with al_destroy_path(3). don’t forget, bestie 😭

πŸ’œ SEE ALSO πŸ’œ


source: Allegro reference manual β€” and this copy doesn’t show a date line, bestie πŸŽ€πŸ’–

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms