Commit Graph

50 Commits (f88afbb27723db5b4f853ef4e19a510816d21a90)

Author SHA1 Message Date
Kacper Gutowski e6c9218319 Don't skip dot files when cleaning cache 6 years ago
Bert Münnich 3c7d6f3528 Replace utf8codepoint with Chris Wellons' utf8_decode
Code under a different license should be kept in a separate file. This
implemention is a single header file with ~65 lines, so it better fits this
requirement.
7 years ago
Squibby eb96c71725 Try to match a fallback font if needed
Fixes #276

Instead of rendering the entire filename at once, Xft will let us do it
character by character. This will allow sxiv to query fontconfig for
a font that can provide any missing codepoints, if needed.

A known issue of this patch is that the "..." dots rendering will not
work properly for very long multibyte filenames. That is because we
cannot easily predict the final width of the rendered filename before
drawing it. I couldn't figure out a clean way to deal with this, so I
ended up just truncating the offending filenames.
7 years ago
Bert Münnich 148026007c One header file for type definitions and function declarations 7 years ago
Paride Legovini 86dc6860f9 Allow opening directories non-recursively 8 years ago
Bert Münnich 53a72c7b65 Fix option -q; commit d3a70a2 completely broke it; fixes issue #223 9 years ago
Bert Münnich a7d39b0ab8 Simplified r_mkdir() 9 years ago
Bert Münnich d3a70a285d Revised error handling
- Functions warn() and die() replaced by GNU-like error(3) function
- Register cleanup() with atexit(3)
- Functions called by cleanup() are marked with CLEANUP and are not allowed to
  call exit(3)
9 years ago
Bert Münnich 851e4288c1 Prefix safe allocation functions with 'e' instead of 's_' 9 years ago
Bert Münnich b096cbd536 Removed unnecessary buffer size constants 9 years ago
Bert Münnich 9a7e97cd89 Use XSI realpath(3) 9 years ago
Bert Münnich 66c3c55759 Use POSIX.1-2008 getline(3) 9 years ago
Bert Münnich e574a6d0dd Removed feature test macro definitions from source files 9 years ago
Bert Münnich e0e96977b3 Removed overcautious parameter checks 9 years ago
Markus Elfring 0f6cb93a09 Bug #165: Deletion of unnecessary null pointer checks
The function "free" performs input parameter validation.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html

It is therefore not needed to check a passed pointer before this function call.
A corresponding update suggestion was generated by the software "Coccinelle"
from the following semantic patch approach.
http://coccinelle.lip6.fr/

@Remove_unnecessary_pointer_checks1@
expression x;
@@
-if (x != \(0 \| NULL\))
    free(x);

@Remove_unnecessary_pointer_checks2@
expression x;
@@
-if (x != \(0 \| NULL\)) {
    free(x);
    x = \(0 \| NULL\);
-}

@Remove_unnecessary_pointer_checks3@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\))
+if (a)
    free(b);

@Remove_unnecessary_pointer_checks4@
expression a, b;
@@
-if (a != \(0 \| NULL\) && b != \(0 \| NULL\)) {
+if (a) {
    free(b);
    b = \(0 \| NULL\);
 }

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
10 years ago
lucas8 3b8a79fb8b Made argument of s_strdup const 10 years ago
Bert Münnich 5cfae63620 Create thumbnail cache dir automatically 10 years ago
Bert Münnich 408b75a0b4 Ignore dotfiles for -r 12 years ago
Bert Münnich 08ae25da22 Refactored function definitions to use dangling brace 12 years ago
Bert Münnich 6d3bbc6d5e Updated/corrected license header 12 years ago
Bert Münnich d407dd65d5 Already in the year 2012 13 years ago
Bert Münnich c3c95ab218 Removed slideshow support 13 years ago
Bert Münnich 36177fb180 Updated contact information 13 years ago
Bert Münnich 4383a651c7 Strictly adhere to ANSI-C standard 13 years ago
Bert Münnich a09b20c5e6 Use void for empty argument lists 13 years ago
Bert Münnich 8dcf682de9 Made all conditionals more precise 13 years ago
Bert Münnich 22d4e991d5 Transformed function macros in util.h to inline functions 13 years ago
Bert Münnich d721d8453e Added STREQ macro 13 years ago
rck 3a81af41ac make use of EXIT_ macros 13 years ago
Bert 510512714d Added slideshow support 13 years ago
Bert 6e575b0f72 Strict conformance to IEEE Std 1003.1-2001 13 years ago
Bert 711494ad36 Avoid conflicting macros 13 years ago
Bert d585b86354 Reformated license header 13 years ago
Bert 1e84773276 Data driven timeout handling 13 years ago
Bert 8b3ae5027e Added support for gif animation 13 years ago
Bert 8763f6930f Corrected FSF address in license headers 13 years ago
Bert ff013dd009 Revised handling of file names & paths 13 years ago
Bert b8ff1677b1 Major code refactoring
- Configurable key and mouse mappings in config.h
- Put event handling code from main.c into events.[ch]
13 years ago
Bert ea23115af4 Use getline instead of readline 13 years ago
Bert a90bd1c833 Refactored recursive directory util functions 13 years ago
Bert e9996882cb Moved read_dir_rec into util.c 13 years ago
Bert 92709b2b2f Use directory structure in cache dir 13 years ago
Bert f93f4d887c Write cache file for thumbnail directly after creating it 13 years ago
Bert c21a3e3f28 Write thumbnail cache files on exit 13 years ago
Bert e8ed491ba9 Fixed empty lines in readline() 14 years ago
Bert cfed65d36f More appropriate buffer sizes 14 years ago
Bert 26cc5aff69 Read filenames from stdin 14 years ago
Bert bad9a70a48 Display filesize in window title 14 years ago
Bert e8cf8da208 Fixed die/warn in util.c 14 years ago
Bert 8f4af658ae Refactored, new files util.[ch], C89 14 years ago