Also move eStrdup() to the correct position in the header.
In addition add the same includes into debug.h as those in uctags (the
removal of vstring inclusion inside routines.h causes compilation errors -
it would be best to explicitly include all needed files in every source to
avoid problems like this but let's do just syncing the two implementations
for now).
keyword.c/h contains only changes made by me. To make the sync complete,
add type.h with type declarations (and remove the added declarations from
their original locations).
Except missing mio_free() in stringListNewFromFile() which has been ported
to uctags.
Except the use of ptrarray for strlist implementation, there's nothing
interesting in the Geany version which would be worth preserving.
Also get the error() implementation from error.c/h (modified slightly to
make sure exit() isn't called and which doesn't call errorPrinter() as
this one should be set somewhere else in the code and it doesn't happen
now).
Convert g_stat() to stat() and introduce eStat() to routines.c/h and use
it instead of getFileSize() and isExecutable().
On the way grab implementations of isSameFile() and tempFile() from
universal-ctags (I haven't checked in detail if all the ifdef cases do the
right thing but these functions aren't probably called in Geany so
we don't have to worry much). Also drop unused setCurrentDirectory().
All the changes in the first half of .c/.h were introduced by me in uctags
(and thus they are guaranteed to be great ;-).
The following functions were missing in our ctags implementation and are
added by this commit (currently unused):
extern vString *vStringNewOrClear (vString *const string);
extern char *vStringDeleteUnwrap (vString *const string);
extern void vStringCatSWithEscaping (vString* b, const char *s);
extern void vStringCatSWithEscapingAsPattern (vString *output, const char* input);
read.c has been updated to use vStringResize() instead of
vStringAutoResize().
Since Geany requires C99 parser, the patch just simply includes stdbool.h
in general.h and drops the TRUE, FALSE definitions inside the same file.
The rest is purely mechanical
boolean -> bool
TRUE -> true
FALSE -> false
plus some alignment fixes.
This patch corresponds to universal-ctags commit ce990805a0a0269c.
Clang warns when comparing an enumeration type with a value not found
in this enumeration:
warning: comparison of constant VALUE with expression of type 'TYPE' is
always false [-Wtautological-constant-out-of-range-compare]
If the compiler then decides to optimize the test away because it
assumes the it is indeed always false, it can lead to pretty subtle and
nasty issues.
Ported universal-ctags patch from Colomban Wendling