/** * TODO: completely rewrite and rename; current implementation do many kernel * calls in the loop which is unacceptable; consider using * signal SIGUSR1 or SIGUSR2 as a notification mechanism. */ int poll_file_location( int fd, int flags, int should_wait ) { /* TODO: completely rewrite; current implementation do many kernel calls in the loop which is unacceptable; consider using signal SIGUSR1 or SIGUSR2 as a notification mechanism */ int ret = -1; do { ret = is_local_file( fd, flags ); } while ( ret == 0 ); return ( ret == -1 ) ? -1 : 0; }
gboolean folder_is_film (const char *folder) { CommentData *cdata; gboolean film = FALSE; if (! is_local_file (folder)) return FALSE; cdata = comments_load_comment (folder, FALSE); if (cdata != NULL) { int i; for (i = 0; i < cdata->keywords_n; i++) if (g_utf8_collate (cdata->keywords[i], _("Film")) == 0) { film = TRUE; break; } comment_data_free (cdata); } return film; }
void file_data_update_mime_type (FileData *fd, gboolean fast_mime_type) { fd->mime_type = get_file_mime_type (fd->path, fast_mime_type || ! is_local_file (fd->path)); }