summarylogtreecommitdiffstats
path: root/0026-Add-showincludes-option.patch
diff options
context:
space:
mode:
authorSergei Litvin2018-09-15 09:05:21 +0300
committerSergei Litvin2018-09-15 09:05:21 +0300
commitcc7efd00835a7a4055510d346b4a068bde18dc56 (patch)
tree3ab00f55b627b3b67dd80c6aad2eb614cb21a7cf /0026-Add-showincludes-option.patch
downloadaur-cc7efd00835a7a4055510d346b4a068bde18dc56.tar.gz
Initial commit
Diffstat (limited to '0026-Add-showincludes-option.patch')
-rw-r--r--0026-Add-showincludes-option.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/0026-Add-showincludes-option.patch b/0026-Add-showincludes-option.patch
new file mode 100644
index 000000000000..d66b041858ba
--- /dev/null
+++ b/0026-Add-showincludes-option.patch
@@ -0,0 +1,98 @@
+From e0ddf603d23c41301a844a803a11d6d75e9150e4 Mon Sep 17 00:00:00 2001
+From: litvin <litvindev@gmail.com>
+Date: Tue, 1 Aug 2017 02:01:13 +0300
+Subject: [PATCH 26/33] Add -showincludes option
+
+---
+ src/globals.c | 1 +
+ src/main.c | 2 ++
+ src/proto.h | 1 +
+ src/yylex.c | 17 +++++++++++++++--
+ 4 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/globals.c b/src/globals.c
+index 66ba837..6cce897 100644
+--- a/src/globals.c
++++ b/src/globals.c
+@@ -433,6 +433,7 @@ S_options s_initOpt = {
+ RegimeXref,
+ "nouser", // -user
+ 0,
++ 0,
+ 1,
+ 0,
+ 0,
+diff --git a/src/main.c b/src/main.c
+index 3ef299d..3f49131 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -91,6 +91,7 @@ static void usage(char *s) {
+ # ifdef DEBUG
+ fprintf(stdout,"\t-debug - produce debug trace of the execution\n");
+ # endif
++ fprintf(stdout,"\t-showincludes - produce trace of include files\n");
+ #if 0
+ fprintf(stdout,"\t-typedefs - generate structure/enums typedefs\n");
+ fprintf(stdout,"\t-str_fill - generate structure fills\n");
+@@ -1386,6 +1387,7 @@ static int processSOption(int *ii, int argc, char **argv) {
+ int i = * ii;
+ char *name, *val;
+ if (0) {}
++ else if (strcmp(argv[i],"-showincludes")==0) s_opt.showIncludes = 1;
+ else if (strcmp(argv[i],"-strict")==0) s_opt.strictAnsi = 1;
+ else if (strcmp(argv[i],"-str_fill")==0) s_opt.str_fill = 1;
+ else if (strcmp(argv[i],"-str_copy")==0) s_opt.str_copy = 1;
+diff --git a/src/proto.h b/src/proto.h
+index 02b08e6..0a8cb38 100644
+--- a/src/proto.h
++++ b/src/proto.h
+@@ -1740,6 +1740,7 @@ struct options {
+ int taskRegime;
+ char *user;
+ int debug;
++ int showIncludes;
+ int cpp_comment;
+ int c_struct_scope;
+ int cxrefs;
+diff --git a/src/yylex.c b/src/yylex.c
+index 5cb5ff5..ae00881 100644
+--- a/src/yylex.c
++++ b/src/yylex.c
+@@ -481,12 +481,12 @@ FILE *openInclude(char pchar, char *name, int nextFlag) {
+ char nn[MAX_FILE_NAME_SIZE];
+ char rdir[MAX_FILE_NAME_SIZE];
+ char *nnn;
+- int nnlen,dlen,fdlen,nmlen,len,ii;
++ int nnlen,dlen,fdlen,nmlen,i;
+ er = NULL; r = NULL;
+ nmlen = strlen(name);
+ copyDir(rdir, cFile.fileName, &fdlen);
+ if (pchar!='<') {
+-/*fprintf(dumpOut, "dlen == %d\n",dlen);*/
++/*&fprintf(dumpOut, "dlen == %d\n",dlen);&*/
+ strcpy(nn,normalizeFileName(name, rdir));
+ /*&fprintf(dumpOut, "try to open %s\n",nn);&*/
+ er = editorFindFile(nn);
+@@ -518,6 +518,19 @@ FILE *openInclude(char pchar, char *name, int nextFlag) {
+ found:
+ nnn = normalizeFileName(nn, s_cwd);
+ strcpy(nn,nnn);
++ if ( (s_opt.taskRegime==RegimeXref
++ || s_opt.taskRegime==RegimeHtmlGenerate)
++ && s_opt.showIncludes) {
++ sprintf(tmpBuff, " ");
++ for(i=0; i<inStacki; i++) sprintf(tmpBuff+strlen(tmpBuff), " ");
++ sprintf(tmpBuff+strlen(tmpBuff),"%s", nn);
++ if (s_opt.xref2) {
++ ppcGenRecord(PPC_INFORMATION, tmpBuff, "\n");
++ } else {
++ fprintf(dumpOut,"'%s'\n", tmpBuff);
++ }
++ fflush(dumpOut);
++ }
+ //&fprintf(dumpOut, "file %s opened\n",nn);
+ //&fprintf(dumpOut, "checking to %s \n",s_fileTab.tab[s_olOriginalFileNumber]->name);
+ pushNewInclude(r, er, nn, "\n");
+--
+2.18.0
+