1al_findfirst(3)                 Allegro manual                 al_findfirst(3)
2
3
4

NAME

6       al_findfirst  -  Low-level  function  for searching files. Allegro game
7       programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       int  al_findfirst(const  char  *pattern,  struct  al_ffblk  *info,  int
14       attrib);
15

DESCRIPTION

17       Low-level  function  for searching files. This function finds the first
18       file which matches the given wildcard specification and file attributes
19       (see above). The information about the file (if any) will be put in the
20       al_ffblk structure which you have to provide.  The  al_ffblk  structure
21       looks like:
22
23          struct al_ffblk
24          {
25             int attrib;       - actual attributes of the file found
26             time_t time;      - modification time of file
27             char name[512];   - name of file
28          };
29
30       There is some other stuff in the structure as well, but it is there for
31       internal use only. Example:
32
33          struct al_ffblk info;
34
35          if (al_findfirst("*.pcx", &info, FA_ALL) != 0) {
36             /* Tell user there are no PCX files. */
37             return;
38          }
39

RETURN VALUE

41       The function returns non-zero if no match  is  found  or  if  an  error
42       occurred  and, in the latter case, sets `errno' accordingly. It returns
43       zero if a match is found, allocating some memory for  internal  use  in
44       the  structure.   Therefore  you have to close your search when you are
45       finished to avoid memory leaks in your program.
46
47

SEE ALSO

49       al_findnext(3), al_findclose(3), al_ffblk_get_size(3)
50
51
52
53Allegro                          version 4.2.3                 al_findfirst(3)
Impressum