For me it's PascalCase functions and snake_case variables.
static char *LookupIconIndexed(IconTheme *theme, const char *icon_name, int size, int scale)
{
if (access(icon_name, F_OK) == 0)
return strdup(icon_name);
char closest_icon_path[512];
int min_size = INT_MAX;
for (size_t i = 0; i < theme->icon_dirs->size; i++)
{
XDGIconDir *curr_icon_dir = theme->icon_dirs->data[i];
// First check the hash map for the icon
const char *icon_path = HashMapGet(curr_icon_dir->icons, icon_name);
if (icon_path == NULL)
continue;
if (DirectoryMatchesSize(curr_icon_dir, size, scale))
{
return strdup(icon_path); // Exact match
}
// Calculate the size difference to find the closest match
int size_delta = DirectorySizeDistance(curr_icon_dir, size, scale);
if (size_delta < min_size)
{
min_size = size_delta;
strlcpy(closest_icon_path, icon_path, sizeof(closest_icon_path));
}
}
// Return the closest icon path found
if (min_size != INT_MAX)
return strdup(closest_icon_path);
return NULL;
}