equal
deleted
inserted
replaced
55 } |
55 } |
56 |
56 |
57 /** |
57 /** |
58 * Compare two FiosItem's. Used with qsort when sorting the file list. |
58 * Compare two FiosItem's. Used with qsort when sorting the file list. |
59 * @param a A pointer to the first FiosItem to compare. |
59 * @param a A pointer to the first FiosItem to compare. |
60 * @param a A pointer to the second FiosItem to compare. |
60 * @param b A pointer to the second FiosItem to compare. |
61 * @return -1, 0 or 1, depending on how the two items should be sorted. |
61 * @return -1, 0 or 1, depending on how the two items should be sorted. |
62 */ |
62 */ |
63 int CDECL compare_FiosItems(const void *a, const void *b) |
63 int CDECL compare_FiosItems(const void *a, const void *b) |
64 { |
64 { |
65 const FiosItem *da = (const FiosItem *)a; |
65 const FiosItem *da = (const FiosItem *)a; |
198 } |
198 } |
199 |
199 |
200 typedef byte fios_getlist_callback_proc(int mode, const char *filename, const char *ext, char *title); |
200 typedef byte fios_getlist_callback_proc(int mode, const char *filename, const char *ext, char *title); |
201 |
201 |
202 /** Create a list of the files in a directory, according to some arbitrary rule. |
202 /** Create a list of the files in a directory, according to some arbitrary rule. |
203 * @param num Will be filled with the amount of items. |
|
204 * @param mode The mode we are in. Some modes don't allow 'parent'. |
203 * @param mode The mode we are in. Some modes don't allow 'parent'. |
205 * @param callback The function that is called where you need to do the filtering. |
204 * @param callback_proc The function that is called where you need to do the filtering. |
206 * @return Return the list of files. */ |
205 * @return Return the list of files. */ |
207 static FiosItem *FiosGetFileList(int mode, fios_getlist_callback_proc *callback_proc) |
206 static FiosItem *FiosGetFileList(int mode, fios_getlist_callback_proc *callback_proc) |
208 { |
207 { |
209 struct stat sb; |
208 struct stat sb; |
210 struct dirent *dirent; |
209 struct dirent *dirent; |