Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create geany.c/h and put isIgnoreToken()
This is a (hopefully) temporary file where we put geany-specific code that for some reason has to be still in ctags. Put isIgnoreToken() in this file.
- Loading branch information
Showing
7 changed files
with
98 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2016, Jiri Techet | ||
* | ||
* This source code is released for free distribution under the terms of the | ||
* GNU General Public License version 2 or (at your option) any later version. | ||
* | ||
* Defines external interface to option processing. | ||
*/ | ||
|
||
#include "general.h" /* must always come first */ | ||
|
||
#include "geany.h" | ||
#include "vstring.h" | ||
|
||
#include <string.h> | ||
#include <glib.h> | ||
|
||
/* tags_ignore is a NULL-terminated array of strings, read from ~/.config/geany/ignore.tags. | ||
* This file contains a space or newline separated list of symbols which should be ignored | ||
* by the C/C++ parser, see -I command line option of ctags for details. */ | ||
gchar **c_tags_ignore = NULL; | ||
|
||
/* Determines whether or not "name" should be ignored, per the ignore list. | ||
*/ | ||
extern bool isIgnoreToken (const char *const name, | ||
bool *const pIgnoreParens, | ||
const char **const replacement) | ||
{ | ||
bool result = false; | ||
|
||
if (c_tags_ignore != NULL) | ||
{ | ||
const size_t nameLen = strlen (name); | ||
unsigned int i; | ||
guint len = g_strv_length (c_tags_ignore); | ||
vString *token = vStringNew(); | ||
|
||
if (pIgnoreParens != NULL) | ||
*pIgnoreParens = false; | ||
|
||
for (i = 0 ; i < len ; ++i) | ||
{ | ||
size_t tokenLen; | ||
|
||
vStringCopyS (token, c_tags_ignore[i]); | ||
tokenLen = vStringLength (token); | ||
|
||
if (tokenLen >= 2 && vStringChar (token, tokenLen - 1) == '*' && | ||
strncmp (vStringValue (token), name, tokenLen - 1) == 0) | ||
{ | ||
result = true; | ||
break; | ||
} | ||
if (strncmp (vStringValue (token), name, nameLen) == 0) | ||
{ | ||
if (nameLen == tokenLen) | ||
{ | ||
result = true; | ||
break; | ||
} | ||
else if (tokenLen == nameLen + 1 && | ||
vStringChar (token, tokenLen - 1) == '+') | ||
{ | ||
result = true; | ||
if (pIgnoreParens != NULL) | ||
*pIgnoreParens = true; | ||
break; | ||
} | ||
else if (vStringChar (token, nameLen) == '=') | ||
{ | ||
if (replacement != NULL) | ||
*replacement = vStringValue (token) + nameLen + 1; | ||
break; | ||
} | ||
} | ||
} | ||
vStringDelete (token); | ||
} | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) 2016, Jiri Techet | ||
* | ||
* This source code is released for free distribution under the terms of the | ||
* GNU General Public License version 2 or (at your option) any later version. | ||
* | ||
* Defines external interface to option processing. | ||
*/ | ||
#ifndef CTAGS_GEANY_H | ||
#define CTAGS_GEANY_H | ||
|
||
extern bool isIgnoreToken (const char *const name, bool *const pIgnoreParens, const char **const replacement); | ||
|
||
#endif /* CTAGS_GEANY_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
#include "read.h" | ||
#include "routines.h" | ||
#include "xtag.h" | ||
#include "geany.h" | ||
|
||
/* | ||
* MACROS | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters