Lines Matching refs:file_name
100 xdg_dir_time_list_add (char *file_name,
107 if (strcmp (list->directory_name, file_name) == 0)
109 free (file_name);
116 list->directory_name = file_name;
139 char *file_name;
144 file_name = malloc (strlen (directory) + strlen ("/mime/mime.cache") + 1);
145 strcpy (file_name, directory); strcat (file_name, "/mime/mime.cache");
146 if (stat (file_name, &st) == 0)
148 XdgMimeCache *cache = _xdg_mime_cache_new_from_file (file_name);
152 xdg_dir_time_list_add (file_name, st.st_mtime);
162 free (file_name);
164 file_name = malloc (strlen (directory) + strlen ("/mime/globs2") + 1);
165 strcpy (file_name, directory); strcat (file_name, "/mime/globs2");
166 if (stat (file_name, &st) == 0)
168 _xdg_mime_glob_read_from_file (global_hash, file_name);
169 xdg_dir_time_list_add (file_name, st.st_mtime);
173 free (file_name);
174 file_name = malloc (strlen (directory) + strlen ("/mime/globs") + 1);
175 strcpy (file_name, directory); strcat (file_name, "/mime/globs");
176 if (stat (file_name, &st) == 0)
178 _xdg_mime_glob_read_from_file (global_hash, file_name);
179 xdg_dir_time_list_add (file_name, st.st_mtime);
183 free (file_name);
187 file_name = malloc (strlen (directory) + strlen ("/mime/magic") + 1);
188 strcpy (file_name, directory); strcat (file_name, "/mime/magic");
189 if (stat (file_name, &st) == 0)
191 _xdg_mime_magic_read_from_file (global_magic, file_name);
192 xdg_dir_time_list_add (file_name, st.st_mtime);
196 free (file_name);
199 file_name = malloc (strlen (directory) + strlen ("/mime/aliases") + 1);
200 strcpy (file_name, directory); strcat (file_name, "/mime/aliases");
201 _xdg_mime_alias_read_from_file (alias_list, file_name);
202 free (file_name);
204 file_name = malloc (strlen (directory) + strlen ("/mime/subclasses") + 1);
205 strcpy (file_name, directory); strcat (file_name, "/mime/subclasses");
206 _xdg_mime_parent_read_from_file (parent_list, file_name);
207 free (file_name);
209 file_name = malloc (strlen (directory) + strlen ("/mime/icons") + 1);
210 strcpy (file_name, directory); strcat (file_name, "/mime/icons");
211 _xdg_mime_icon_read_from_file (icon_list, file_name);
212 free (file_name);
214 file_name = malloc (strlen (directory) + strlen ("/mime/generic-icons") + 1);
215 strcpy (file_name, directory); strcat (file_name, "/mime/generic-icons");
216 _xdg_mime_icon_read_from_file (generic_icon_list, file_name);
217 free (file_name);
344 char *file_name;
349 file_name = malloc (strlen (directory) + strlen ("/mime/mime.cache") + 1);
350 strcpy (file_name, directory); strcat (file_name, "/mime/mime.cache");
351 invalid = xdg_check_file (file_name, &exists);
352 free (file_name);
364 file_name = malloc (strlen (directory) + strlen ("/mime/globs") + 1);
365 strcpy (file_name, directory); strcat (file_name, "/mime/globs");
366 invalid = xdg_check_file (file_name, NULL);
367 free (file_name);
375 file_name = malloc (strlen (directory) + strlen ("/mime/magic") + 1);
376 strcpy (file_name, directory); strcat (file_name, "/mime/magic");
377 invalid = xdg_check_file (file_name, NULL);
378 free (file_name);
484 xdg_mime_get_mime_type_for_file (const char *file_name,
500 if (file_name == NULL)
502 if (! _xdg_utf8_validate (file_name))
508 return _xdg_mime_cache_get_mime_type_for_file (file_name, statbuf);
510 base_name = _xdg_get_base_name (file_name);
518 if (stat (file_name, &buf) != 0)
535 file = fopen (file_name, "r");
563 xdg_mime_get_mime_type_from_file_name (const char *file_name)
570 return _xdg_mime_cache_get_mime_type_from_file_name (file_name);
572 if (_xdg_glob_hash_lookup_file_name (global_hash, file_name, &mime_type, 1))
579 xdg_mime_get_mime_types_from_file_name (const char *file_name,
586 return _xdg_mime_cache_get_mime_types_from_file_name (file_name, mime_types, n_mime_types);
588 return _xdg_glob_hash_lookup_file_name (global_hash, file_name, mime_types, n_mime_types);