Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
paths.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define O_BINARY   0
#define DT_MAX_FILENAME_LEN   256
#define DT_PATH_MAX   4096
 Buffer size for a filesystem path anywhere in Ansel.
#define DT_MAX_PATH_FOR_PARAMS   4096

Functions

void dt_concat_path_file (char destination[4096], const char path[4096], const char *const file)
 Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between.

Macro Definition Documentation

◆ DT_MAX_FILENAME_LEN

#define DT_MAX_FILENAME_LEN   256

define for max path/filename length

Definition at line 35 of file paths.h.

Referenced by _default_pipe_hash(), _image_cache_self_hash(), dt_get_lightroom_xmp(), and dt_image_rename().

◆ DT_MAX_PATH_FOR_PARAMS

#define DT_MAX_PATH_FOR_PARAMS   4096

Definition at line 65 of file paths.h.

Referenced by legacy_params(), main(), params_size(), and store().

◆ DT_PATH_MAX

#define DT_PATH_MAX   4096

Buffer size for a filesystem path anywhere in Ansel.

This is deliberately NOT the system PATH_MAX. That macro is not a constant across the platforms we ship: 4096 on Linux, 1024 on macOS, and 260 on Windows – mingw's <limits.h> defines it unconditionally, and redefines it to 512 under POSIX, so it even overrides a value we set first.

What used to live here was #ifndef PATH_MAX / #define PATH_MAX 4096, which is dead code on all three platforms, because all three define it. The visible consequence was that every char buf[PATH_MAX] in the tree – including the five path members of dt_image_t – was a 4096-byte buffer when built on Linux and a 260-byte one when built on Windows, where paths under LOCALAPPDATA% get close to that and were silently truncated by the g_strlcpy/snprintf that fill them.

Sizing our own buffers is our decision, so we make it once, here, for every platform. Note this does not by itself let Windows OPEN a path longer than its own MAX_PATH – that needs a long-path-aware manifest – it only stops us truncating before the OS is ever asked.

Definition at line 57 of file paths.h.

Referenced by __attribute__(), _build_softproof_gamut_popover(), _crawl_image(), _create_background_layer_from_input(), _create_new_layer(), _database_delete_mipmaps_files(), _database_init(), _database_migrate_to_xdg_structure(), _delete_current_layer(), _dt_check_basedir(), _dt_dev_mipmap_prefetch_full(), _event_dnd_get(), _export_list_build(), _export_source_available(), _find_sidecar_jpg(), _generate_blocking(), _generate_one(), _get_custom_model(), _get_model(), _get_thumbnail_input(), _handle_get_property(), _image_import_internal(), _import_copy_xmp(), _import_image(), _init_8(), _init_expansion(), _init_f(), _lib_geotagging_get_timezones(), _list_custom_models(), _ls_db(), _metadata_view_update_values(), _noiseprofile_load(), _opencl_driver_crash_marker_path(), _prerender_job(), _rename_current_layer_from_gui(), _set_image_paths(), _splash_build_data_path(), _splash_create_logo(), _splash_load_authors(), _test_copy_directory_failure_reports_only_its_cause(), _update_preview(), _util_get_svg_img(), _view_image_get_surface_internal(), _view_map_dnd_get_callback(), _watermark_get_svgdoc(), _write_sidecar_file_from_image_locked(), _write_thumbnail_to_disk_cache(), dt_collection_load_filmroll(), dt_collection_notify_imported(), dt_colorchecker_find_CGATS_reference_files(), dt_colorchecker_find_cht_files(), dt_concat_path_file(), dt_conf_expand_default_dir(), dt_control_delete_images_job_run(), dt_control_merge_hdr_job_run(), dt_control_refresh_exif_run(), dt_control_save_xmps_job_run(), dt_copy_resource_file(), dt_curl_init(), dt_drawlayer_canvas_from_sidecar(), dt_drawlayer_ensure_layer_cache(), dt_drawlayer_flush_layer_cache(), dt_drawlayer_layers_populate_list(), dt_exif_xmp_attach_export(), dt_exif_xmp_read_string(), dt_folder_survey_init(), dt_get_dirname_from_imgid(), dt_get_user_pictures_dir(), dt_gui_gtk_init(), dt_gui_load_theme(), dt_gui_preferences_show(), dt_image_cache_write_release(), dt_image_copy_rename(), dt_image_find_best_color_profile(), dt_image_find_xmps(), dt_image_get_audio_path(), dt_image_get_text_path(), dt_image_local_copy_paths_from_fullpath(), dt_image_local_copy_reset(), dt_image_local_copy_set(), dt_image_local_copy_synch(), dt_image_read_duplicates(), dt_image_rename(), dt_image_resolve_usercrop(), dt_image_safe_remove(), dt_imageio_export_with_flags(), dt_imageio_load_modules_format(), dt_imageio_load_modules_storage(), dt_imageio_open_rawspeed(), dt_import_duplicate_get_dest_name(), dt_init(), dt_l10n_init(), dt_loc_init_generic(), dt_mipmap_cache_allocate_dynamic(), dt_mipmap_cache_copy_thumbnails(), dt_mipmap_cache_get_filename(), dt_mipmap_cache_unlink_ondisk_thumbnail(), dt_mipmap_get_cache_dir(), dt_mipmap_get_cache_filename(), dt_opencl_build_program(), dt_opencl_device_init(), dt_opencl_load_program(), dt_opencl_md5sum(), dt_print_file(), dt_rawspeed_load_meta(), dt_styles_save_to_file(), finalize_store(), generate_thumbnail_cache(), get_language_names(), gui_init(), gui_init(), init_tab_general(), load_profile_from_dir(), load_themes(), load_xmp_callback(), main(), main(), preload_image_cache(), process(), refresh_watermarks(), save_usercss(), store(), store(), try_enter(), win_image_find_duplicates(), and write_image().

◆ O_BINARY

#define O_BINARY   0

Definition at line 24 of file paths.h.

Referenced by expose().

Function Documentation

◆ dt_concat_path_file()

void dt_concat_path_file ( char destination[4096],
const char path[4096],
const char *const file )

Append a constant filename to a variable, stack-based, fixed-sized, directory, and add a / in-between.

Parameters
destination
variable
string

Definition at line 2683 of file darktable.c.

References DT_PATH_MAX.

Referenced by _database_delete_mipmaps_files(), _database_init(), _database_migrate_to_xdg_structure(), _get_custom_model(), _get_model(), _ls_db(), _noiseprofile_load(), dt_gui_gtk_init(), dt_init(), dt_mipmap_get_cache_filename(), dt_opencl_device_init(), dt_opencl_load_program(), dt_opencl_md5sum(), dt_rawspeed_load_meta(), and dt_styles_save_to_file().