YedPoll - Get_Dir_Entries

NAME:
Get_Dir_Entries

SYNOPSIS:
SFileData* Get_Dir_Entries(void *pvO,SCHAR scSortType,SCHAR scSortMode,
                           void *pvOther);

DESCRIPTION:
The method returns the list of entries extracted and filtered with a previous call to Scan_Dir.
scSortType flag sets order type, as below:

SORT_NONE
No sort requested.

SORT_LASTACCESS
Sorting entries according to their last access time; this time is corresponding to st_atime item of struct stat instance of the entry.

SORT_LASTMOD
Sorting entries according to their last modify time; this time is corresponding to st_mtime item of struct stat instance of the entry.

SORT_LASTCNGINODE
Sorting entries according to their last change in inode information time; this time is corresponding to st_ctime item of struct stat instance of the entry.

SORT_ALFAOMEGA
Sorting entries in alphabetical order.

SORT_TOKEN
Sorting entries according to specific tokens inside entry name.

scSortMode flag sets order mode, as below:

SORT_YOUNG
Sorting entries from young to old. Using in conjunction with type SORT_LASTACCESS, SORT_LASTMOD, SORT_LASTCNGINODE.

SORT_OLD
Sorting entries from old to young. Using in conjunction with type SORT_LASTACCESS, SORT_LASTMOD, SORT_LASTCNGINODE.

SORT_ASCENDING
Sorting entries in ascending mode ( a-z ). Using in conjunction with type SORT_ALFAOMEGA, SORT_TOKEN.

SORT_DESCENDING
Sorting entries in descending mode ( z-a ). Using in conjunction with type SORT_ALFAOMEGA, SORT_TOKEN.

Setting an order mode not compatible with an order type ( i.e. SORT_YOUNG in conjunction with SORT_ALFAOMEGA ) results in a non-ordered list of entries. This could be possible also setting SORT_TOKEN type with invalid additional data ( see below ), or in case of error in ordering in SORT_TOKEN type.

Pointer pvOther is a pointer to additional data needed in particular ordering operations. If SORT_TOKEN type is set, pvOther must point to a valid instance of a SSortToken structure; this structure must have these fields opportunely set:

scbToken
pointer to a character array containing all token separators to be considered in parsing entry name. In example, in entry name a_b,c.txt, this array can be '_,.' , or '_', if this character is the only token separator you want to consider.

siTokenPosition
an integer indicating what token must be considered in ordering operations. Its value is 1-based, then, in the above example, the value '3' indicates the third token, that is 'c', as the token to be considered in ordering operations.

Pointer pvOther can be NULL if no additional data are needed.

RETURN VALUE:
The method returns a pointer to the list of entries filtered and extracted with Scan_Dir method, eventually ordered according to input flags. This list is stored in an array of SFileData structure, which contains the following fields:

typedef struct {
    time_t tLastAccess;      // last access time
    time_t tLastModify;      // last modification time
    time_t tLastChange;      // last change time
    SCHAR scbNome[1024];     // entry name
} SFileData;

The number of elements in SFileData array is the same returning from Scan_Dir method.

The method returns NULL if:


http://yed.sourceforge.net