[geany/geany] 112f13: lregex: introduce findRegexTagsMainloop()

Jiří Techet git-noreply at xxxxx
Mon Dec 17 21:05:56 UTC 2018


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Wed, 12 Oct 2016 15:38:48 UTC
Commit:      112f136a0aba0a4ad2a4de76f10f0b7d0fdf8446
             https://github.com/geany/geany/commit/112f136a0aba0a4ad2a4de76f10f0b7d0fdf8446

Log Message:
-----------
lregex: introduce findRegexTagsMainloop()

Does the same thing like the previous code.


Modified Paths:
--------------
    ctags/main/lregex.c
    ctags/main/parse.h

Modified: ctags/main/lregex.c
16 lines changed, 14 insertions(+), 2 deletions(-)
===================================================================
@@ -36,6 +36,7 @@
 #include "routines.h"
 
 static bool regexAvailable = true;
+static unsigned long currentScope = CORK_NIL;
 
 /*
 *   MACROS
@@ -583,13 +584,24 @@ extern bool matchRegex (const vString* const line, const langType language)
 	return result;
 }
 
-extern void findRegexTags (void)
+extern void findRegexTagsMainloop (int (* driver)(void))
 {
+	currentScope = CORK_NIL;
 	/* merely read all lines of the file */
-	while (readLineFromInputFile () != NULL)
+	while (driver () != EOF)
 		;
 }
 
+static int fileReadLineDriver(void)
+{
+	return (readLineFromInputFile () == NULL)? EOF: 1;
+}
+
+extern void findRegexTags (void)
+{
+	findRegexTagsMainloop (fileReadLineDriver);
+}
+
 static regexPattern *addTagRegexInternal (const langType language,
 					  const char* const regex,
 					  const char* const name,


Modified: ctags/main/parse.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -141,6 +141,7 @@ extern bool processKindOption (const char *const option, const char *const param
 
 /* Regex interface */
 extern void findRegexTags (void);
+extern void findRegexTagsMainloop (int (* driver)(void));
 extern bool matchRegex (const vString* const line, const langType language);
 extern bool processRegexOption (const char *const option, const char *const parameter);
 extern void addLanguageRegex (const langType language, const char* const regex);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list