Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
al_for_each_fs_entry(3)	   Library Functions Manual    al_for_each_fs_entry(3)

NAME
       al_for_each_fs_entry - Allegro 5	API

SYNOPSIS
	      #include <allegro5/allegro.h>

	      int al_for_each_fs_entry(ALLEGRO_FS_ENTRY	*dir,
				       int (*callback)(ALLEGRO_FS_ENTRY	*dir, void *extra),
				       void *extra)

DESCRIPTION
       This function takes the ALLEGRO_FS_ENTRY(3) dir,	which should represent
       a  directory,  and  looks for any other file system entries that	are in
       it.  This function will then call the callback function	callback  once
       for every filesystem entry in the directory dir.

       The  callback  callback must be of type int callback(ALLEGRO_FS_ENTRY *
       entry, void * extra).  The callback will	be called with a pointer to an
       ALLEGRO_FS_ENTRY(3) that	matches	one file or directory in dir, and  the
       pointer passed in the extra parameter to	al_for_each_fs_entry(3).

       When   callback	 returns   ALLEGRO_FOR_EACH_FS_ENTRY_STOP   or	 ALLE-
       GRO_FOR_EACH_FS_ENTRY_ERROR,  iteration	will  stop   immediately   and
       al_for_each_fs_entry(3) will return the value the callback returned.

       When  callback returns ALLEGRO_FOR_EACH_FS_ENTRY_OK iteration will con-
       tinue normally, and if the ALLEGRO_FS_ENTRY(3) parameter	of callback is
       a directory, al_for_each_fs_entry(3) will call itself  on  that	direc-
       tory.   Therefore the function will recusively descend into that	direc-
       tory.

       However,	when callback returns ALLEGRO_FOR_EACH_FS_ENTRY_SKIP iteration
       will continue, but al_for_each_fs_entry(3) will NOT  recurse  into  the
       ALLEGRO_FS_ENTRY(3) parameter of	callback even if it is a directory.

       This  function  will  skip any files or directories named . or .. which
       may exist on certain platforms and may signify the current and the par-
       ent directory.  The callback will not be	called for files  or  directo-
       ries with such a	name.

       Returns	  ALLEGRO_FOR_EACH_FS_ENTRY_OK	 if   successful,   or	 ALLE-
       GRO_FOR_EACH_FS_ENTRY_ERROR if something	went wrong in  processing  the
       directory.   In	that  case it will use al_set_errno(3) to indicate the
       type  of	 error	which	occurred.    This   function   returns	 ALLE-
       GRO_FOR_EACH_FS_ENTRY_STOP  in  case  iteration	was  stopped by	making
       callback	return that value.  In this case, al_set_errno(3) will not  be
       used.

SEE ALSO
       ALLEGRO_FOR_EACH_FS_ENTRY_RESULT(3)

SINCE
       5.1.9

Allegro	reference manual			       al_for_each_fs_entry(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_for_each_fs_entry&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help