for_each_file_ex man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

for_each_file_ex(3)		Allegro manual		   for_each_file_ex(3)

NAME
       for_each_file_ex	 -  Executes callback() for each file matching a wild‐
       card. Allegro game programming library.

SYNOPSIS
       #include <allegro.h>

       int for_each_file_ex(const char *name, int in_attrib,  int  out_attrib,
       int  (*callback)(const  char  *filename, int attrib, void *param), void
       *param);

DESCRIPTION
       Finds all the files on disk which match the given  wildcard  specifica‐
       tion  and file attributes, and executes callback() once for each. Basi‐
       cally, this is a convenient  wrapper  around  al_findfirst(),  al_find‐
       next()  and  al_findclose().  `in_attrib'  is  a bitmask specifying the
       attributes the files must carry, `out_attrib' is a  bitmask  specifying
       the attributes the files must not carry; attributes which are not spec‐
       ified in either bitmasks	 are  not  taken  into	account	 for  deciding
       whether callback() is invoked or not.

       The  callback  function	will be passed three arguments: the first is a
       string which contains the completed filename (exactly the  same	string
       you  passed to for_each_file_ex() but with meta characters), the second
       is the actual attributes of the file, and the third is a	 void  pointer
       which  is  simply  a copy of `param' (you can use this for whatever you
       like). The callback must return zero to let the enumeration proceed, or
       any  non-zero value to stop it. If an error occurs, the error code will
       be stored in `errno' but the enumeration won't stop. Example:

	  int show_name(const char *filename, int attrib, void *param)
	  {
	     allegro_message("Caught `%s', attribs %d\n",
			     filename, attrib);
	     return 0;
	  }
	  ...
	     count = for_each_file_ex("data/level*", FA_DIREC,
				      0, show_name, 0);
	     allegro_message("%d game directories\n", count);

RETURN VALUE
       Returns the number of successful calls made to callback(), that is, the
       number of times callback() was called and returned 0.

SEE ALSO
       al_findfirst(3), al_findnext(3), al_findclose(3)

Allegro				 version 4.4.2		   for_each_file_ex(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net