/* * Allocated structure returned from os_open_directory
*/ typedefstruct external_find_info { char *dir_pathname;
DIR *dir_ptr; char temp_buffer[256]; char *wildcard_spec; char requested_file_type;
} external_find_info;
/******************************************************************************* * * FUNCTION: acpi_os_open_directory * * PARAMETERS: dir_pathname - Full pathname to the directory * wildcard_spec - string of the form "*.c", etc. * * RETURN: A directory "handle" to be used in subsequent search operations. * NULL returned on failure. * * DESCRIPTION: Open a directory in preparation for a wildcard search *
******************************************************************************/
/******************************************************************************* * * FUNCTION: acpi_os_get_next_filename * * PARAMETERS: dir_handle - Created via acpi_os_open_directory * * RETURN: Next filename matched. NULL if no more matches. * * DESCRIPTION: Get the next file in the directory that matches the wildcard * specification. *
******************************************************************************/
char *acpi_os_get_next_filename(void *dir_handle)
{ struct external_find_info *external_info = dir_handle; struct dirent *dir_entry; char *temp_str; int str_len; struct stat temp_stat; int err;
while ((dir_entry = readdir(external_info->dir_ptr))) { if (!fnmatch
(external_info->wildcard_spec, dir_entry->d_name, 0)) { if (dir_entry->d_name[0] == '.') { continue;
}
/******************************************************************************* * * FUNCTION: acpi_os_close_directory * * PARAMETERS: dir_handle - Created via acpi_os_open_directory * * RETURN: None. * * DESCRIPTION: Close the open directory and cleanup. *
******************************************************************************/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.