1find_allegro_resource(3) Allegro manual find_allegro_resource(3)
2
3
4
6 find_allegro_resource - Searches for a support file in many places.
7 Allegro game programming library.
8
10 #include <allegro.h>
11
12
13 int find_allegro_resource(char *dest, const char *resource, const char
14 *ext, const char *datafile, const char *objectname, const char *envvar,
15 const char *subdir, int size);
16
18 Searches for a support file, eg. `allegro.cfg' or `language.dat'.
19 Passed a resource string describing what you are looking for, along
20 with extra optional information such as the default extension, what
21 datafile to look inside, what the datafile object name is likely to be,
22 any special environment variable to check, and any subdirectory that
23 you would like to check as well as the default location, this function
24 looks in a hell of a lot of different places :-). Pass NULL for the
25 parameters you are not using.
26
27 Check the documentation chapter specific to your platform for informa‐
28 tion on additional paths this function might search for. Also, don't
29 forget about set_allegro_resource_path() to extend the searches. Exam‐
30 ple:
31
32 char path[256];
33 int ret;
34 ret = find_allegro_resource(path, "scores.cfg", NULL, NULL,
35 NULL, NULL, NULL, sizeof(path));
36 if (ret == 0) {
37 /* Found system wide scores file. */
38 } else {
39 /* No previous scores, create our own file. */
40 }
41
43 Returns zero on success, and stores a full path to the file (at most
44 size bytes) into the dest buffer.
45
46
48 set_allegro_resource_path(3)
49
50
51
52Allegro version 4.4.3 find_allegro_resource(3)