00001 #ifndef VSF_LS_H 00002 #define VSF_LS_H 00003 00004 struct mystr; 00005 struct mystr_list; 00006 struct vsf_sysutil_dir; 00007 00008 /* vsf_ls_populate_dir_list() 00009 * PURPOSE 00010 * Given a directory handle, populate a formatted directory entry list (/bin/ls 00011 * format). Also optionally populate a list of subdirectories. 00012 * PARAMETERS 00013 * p_list - the string list object for the result list of entries 00014 * p_subdir_list - the string list object for the result list of 00015 * subdirectories. May be 0 if client is not interested. 00016 * p_dir - the directory object to be listed 00017 * p_base_dir_str - the directory name we are listing, relative to current 00018 * p_option_str - the string of options given to the LIST/NLST command 00019 * p_filter_str - the filter string given to LIST/NLST - e.g. "*.mp3" 00020 * is_verbose - set to 1 for LIST, 0 for NLST 00021 */ 00022 void vsf_ls_populate_dir_list(struct mystr_list* p_list, 00023 struct mystr_list* p_subdir_list, 00024 struct vsf_sysutil_dir* p_dir, 00025 const struct mystr* p_base_dir_str, 00026 const struct mystr* p_option_str, 00027 const struct mystr* p_filter_str, 00028 int is_verbose); 00029 00030 /* vsf_filename_passes_filter() 00031 * PURPOSE 00032 * Determine whether the given filename is matched by the given filter string. 00033 * The format of the filter string is a small subset of a regular expression. 00034 * Currently, just * and ? are supported. 00035 * PARAMETERS 00036 * p_filename_str - the filename to match 00037 * p_filter_str - the filter to match against 00038 * RETURNS 00039 * Returns 1 if there is a match, 0 otherwise. 00040 */ 00041 int vsf_filename_passes_filter(const struct mystr* p_filename_str, 00042 const struct mystr* p_filter_str); 00043 00044 #endif /* VSF_LS_H */ 00045