87 Commits

Author SHA1 Message Date
Jiří Techet
2b8c7ae5ad Sync the rest of routines.c/h
Requires checking for errno.h limits.h in autoconf as there are ifdefs
around those in routines.c.
2016-10-08 14:12:45 +02:00
Jiří Techet
65f782b6d2 Don't initialize ExecutableProgram and ExecutableName
We shouldn't need it.
2016-10-08 14:12:45 +02:00
Jiří Techet
d5b60d2f21 Use uctags implementation of strstr() 2016-10-08 14:12:45 +02:00
Jiří Techet
3219d9783c Make sure that file extension is taken from file (not preceding directory) 2016-10-08 14:12:45 +02:00
Jiří Techet
9e7eade7c0 Use parse separator utilities in routines.c 2016-10-08 14:12:45 +02:00
Jiří Techet
f0e7af2c32 Make combinePathAndFile() return char * instead of vString
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).
2016-10-08 14:12:45 +02:00
Jiří Techet
fb4fc07b6a Make tempFile() return MIO 2016-10-08 14:12:45 +02:00
Jiří Techet
ed01b7edb4 Grab uctags keyword.c/h and add types.h with type declarations
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).
2016-10-08 14:12:44 +02:00
Jiří Techet
a52137f414 Grab uctags implementation of strlist
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.
2016-10-08 14:12:44 +02:00
Jiří Techet
ed6d24bb9a Remove unused functions from options.c/h 2016-10-08 14:12:44 +02:00
Jiří Techet
2f1ad0232b Remove most uses of glib calls
Some special cases which require more work still remain, plus there's
still GRegex.
2016-10-08 14:12:44 +02:00
Jiří Techet
560107804c Drop some more unused functions from routines.c/h
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).
2016-10-08 14:12:35 +02:00
Jiří Techet
d88a9dd3fc Eliminate uses of g_stat()
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().
2016-10-06 17:20:36 +02:00
Jiří Techet
992306aec3 Add generic pointer array 2016-10-06 15:41:19 +02:00
Jiří Techet
227b808799 Grab the complete uctags vString implementation
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().
2016-10-06 15:33:24 +02:00
Jiří Techet
40396a392e ctags: drop vStringTerminate()
It's call is unnecesssary. Corresponds to universal-ctags commit
cfc45e3bd9000e8ce193399c7e0ecf2bbeb57977.
2016-10-04 18:06:33 +02:00
Jiří Techet
662765852f ctags: Use bool definitions from stdbool.h
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.
2016-10-04 18:05:54 +02:00
Jiří Techet
63c054a61e #if 0 currently unused code to avoid compiler warning 2016-09-09 18:00:41 +02:00
Jiří Techet
f511787f31 Add missing prototypes 2016-09-09 17:46:13 +02:00
Jiří Techet
1e14667bbc Don't compare foreign values to enumeration type
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
2016-09-09 17:18:17 +02:00
Jiří Techet
cb7da79824 Add CTAGS_ATTR_ prefix to UNUSED() and PRINTF() macros
Also fix the macro use in objc.c to appear behind variables.
2016-08-22 14:54:19 +02:00
Jiří Techet
b7f7ce2675 Drop vi modelines 2016-08-19 15:16:32 +01:00
Jiří Techet
a974f35752 Define KEYWORD_NONE in keyword.h so it doesn't have to be defined by parsers 2016-08-16 13:18:50 +01:00
Jiří Techet
d0cc3dc132 Remove TagEntryFunction check in c.c
It's always non-null in Geany, it's value is checked in makeTagEntry()
anyway and parsers shouldn't know about it.
2016-08-10 11:55:02 +02:00
Jiří Techet
0eca258e58 Fix incorrect use of MIO 2016-08-09 00:34:29 +02:00
Jiří Techet
e866a976c9 entry: Move functions around a bit to reduce the amount of diffs 2016-08-08 23:01:14 +02:00
Jiří Techet
ca65fa2236 Sync whitespace and comments in main 2016-08-07 18:31:30 +02:00
Jiří Techet
967b572240 Rename MIO variables from fp to mio 2016-08-07 18:31:30 +02:00
Jiří Techet
02138f9e59 Rename TM_DEBUG macro to DEBUG 2016-08-07 18:31:30 +02:00
Jiří Techet
25c1d220cf objc: Remove unnecessary redefinition of UNUSED 2016-08-07 18:31:30 +02:00
Jiří Techet
a59f82ec69 Rename getArglistFromFilePos() to cppGetArglistFromFilePos() to match the rest 2016-08-07 18:31:30 +02:00
Jiří Techet
20ad9ad428 Make getArglistFromStr() static 2016-08-07 18:31:30 +02:00
Jiří Techet
d122229902 Rename skipOverCComment() to cppSkipOverCComment() 2016-08-07 18:31:30 +02:00
Jiří Techet
4910e2554b Rename getDirectiveNestLevel() to cppGetDirectiveNestLevel() 2016-08-07 18:31:30 +02:00
Jiří Techet
2638899379 Rename isBraceFormat to cppIsBraceFormat() 2016-08-07 18:31:30 +02:00
Jiří Techet
88a8724d1c Rename isident1() to cppIsident1() 2016-08-07 18:31:30 +02:00
Jiří Techet
95f94629f0 Rename isident() to cppIsident() 2016-08-07 18:31:30 +02:00
Jiří Techet
1d48599d3c Remove R regex parser
Unused by us, not present in uctags.
2016-08-07 18:31:30 +02:00
Jiří Techet
2671d73b67 Use skipToCharacterInInputFile() in all parsers 2016-08-07 18:31:30 +02:00
Jiří Techet
76818f9439 Change getSourceFileName() to getInputFileName() 2016-08-07 18:31:25 +02:00
Jiří Techet
2161b73864 Change isHeaderFile() to isInputHeaderFile() 2016-08-07 18:22:49 +02:00
Jiří Techet
7bd81abc1d Change isLanguage() to isInputLanguage() 2016-08-07 02:15:12 +02:00
Jiří Techet
082a9724f1 Use ARRAY_SIZE() in parsers 2016-08-07 02:01:38 +02:00
Jiří Techet
9745d470c6 Sync whitespace in parsers 2016-08-07 02:01:33 +02:00
Jiří Techet
11dcc5e3e5 Fix indentation 2016-08-06 22:42:37 +02:00
Jiří Techet
026da60fd0 Move selected() under Miscellaneous macros 2016-08-06 22:42:15 +02:00
Jiří Techet
0650707ce5 Fix pascal tag initizalization 2016-08-06 22:06:41 +02:00
Jiří Techet
0ec3590e19 Remove makeSimpleScopedTag() and fix scope for conf filetype 2016-08-06 22:01:05 +02:00
Jiří Techet
530f47584a Revert "Rename "mio" member of sInputFile to "fp""
Let's rename fp to mio in uctags instead.

This reverts commit 3dd1fb4853952d8fd80963952a03299e9b2c8012.

Conflicts:
	ctags/main/read.c
	ctags/main/read.h
2016-08-06 16:34:37 +02:00
Jiří Techet
eb45c80058 Always define ExecutableName variable 2016-08-03 12:21:51 +02:00