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
This is mostly just moving code with just some minor modifications:
- removal of code of unsupported platforms (VAX, OS2, etc.)
- syncing includes/headers of affected files with uctags
- removal of some functions we don't need in Geany and whose movement
would require additional changes (those will get added back when
doing final sync with uctags)
- minor whitespace syncs
The usage in lregex is hacky (casting const char * to char *) but it's
the quickest way to implement it right now (the question is whether
we shouldn't revert back to POSIX regex and simply use the uctags
implementation).