YedPoll - An example

Scanning directory '.', and extracting file names containing string 'txt' in alfabetical descending order:

#include <stdio.h>
#include <yedstd.h>
#include <yedpoll.h>

main() {
SFileData *d;
int s,i;

YedPoll *p=New(YedPoll);

p->Set_Dir(p,".");

s=p->Scan_Dir(p,"txt\0\0",POLL_FILES,YPSTORE);

i=p->Get_Size_Dir_Entries(p);

printf("Size of files containing 'txt' in directory '.': [%d]\n",i);

d=p->Get_Dir_Entries(p,SORT_ALFAOMEGA,SORT_DESCENDING,NULL);
if(d!=NULL) {
  for(i=0;i<s;i++) {
    printf("[%.2d]=[%+20s]\n",i+1,d[i].scbNome);
     }
  }

Delete(YedPoll,p);
}


http://yed.sourceforge.net