geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

writer-xref.c
Go to the documentation of this file.
1/*
2* Copyright (c) 1998-2002, Darren Hiebert
3*
4* This source code is released for free distribution under the terms of the
5* GNU General Public License version 2 or (at your option) any later version.
6*
7* External interface to entry.c
8*/
9
10#include "general.h" /* must always come first */
11
12#include "entry.h"
13#include "field_p.h"
14#include "fmt_p.h"
15#include "mio.h"
16#include "options_p.h"
17#include "ptag_p.h"
18#include "writer_p.h"
19
20#include <string.h>
21
22
24 MIO * mio, const tagEntryInfo *const tag,
25 void *clientData CTAGS_ATTR_UNUSED);
26static int writeXrefPtagEntry (tagWriter *writer, MIO * mio, const ptagDesc *desc,
27 const char *const fileName,
28 const char *const pattern,
29 const char *const parserName,
30 void *clientData);
31
34 .writePtagEntry = writeXrefPtagEntry,
35 .printPtagByDefault = false,
36 .preWriteEntry = NULL,
37 .postWriteEntry = NULL,
38 .rescanFailedEntry = NULL,
39 .treatFieldAsFixed = NULL,
40 .defaultFileName = NULL,
41};
42
43static int writeXrefPtagEntry (tagWriter *writer, MIO * mio, const ptagDesc *desc,
44 const char *const fileName,
45 const char *const pattern,
46 const char *const parserName,
47 void *clientData)
48{
51
52 memset (&e, 0, sizeof(e));
53
54 e.isPseudoTag = 1;
55
56 vStringCatS (name, desc->name);
57 if (parserName)
58 {
60 vStringCatS (name, parserName);
61 }
63 e.inputFileName = fileName;
64 e.pattern = pattern;
65
66 int length = writeXrefEntry (writer, mio, &e, clientData);
67
69
70 return length;
71}
72
74 MIO * mio, const tagEntryInfo *const tag,
75 void *clientData CTAGS_ATTR_UNUSED)
76{
77 int length;
78 static fmtElement *fmt1;
79 static fmtElement *fmt2;
80
82 length = fmtPrint (Option.customXfmt, mio, tag);
83 else
84 {
85 if (tag->isFileEntry)
86 return 0;
87
88 if (Option.tagFileFormat == 1)
89 {
90 if (fmt1 == NULL)
91 fmt1 = fmtNew ("%-16N %4n %-16F %C");
92 length = fmtPrint (fmt1, mio, tag);
93 }
94 else
95 {
96 if (fmt2 == NULL)
97 fmt2 = fmtNew ("%-16N %-10K %4n %-16F %C");
98 length = fmtPrint (fmt2, mio, tag);
99 }
100 }
101
102 mio_putc (mio, '\n');
103 length++;
104
105 return length;
106}
const gchar * name
Definition: document.c:3219
fmtElement * fmtNew(const char *fmtString)
Definition: fmt.c:248
int fmtPrint(fmtElement *fmtelts, MIO *fp, const tagEntryInfo *tag)
Definition: fmt.c:365
#define CTAGS_ATTR_UNUSED
Definition: gcc-attr.h:22
int mio_putc(MIO *mio, int c)
mio_putc: @mio: A MIO object : The character to write
Definition: mio.c:729
optionValues Option
Definition: options.c:137
#define PSEUDO_TAG_SEPARATOR
Definition: ptag_p.h:19
#define PSEUDO_TAG_PREFIX
Definition: ptag_p.h:18
#define NULL
Definition: rbtree.h:150
MIO:
Definition: mio.c:136
unsigned int tagFileFormat
Definition: options_p.h:102
fmtElement * customXfmt
Definition: options_p.h:97
const char * name
Definition: ptag_p.h:58
const char * name
Definition: entry.h:63
const char * inputFileName
Definition: entry.h:62
unsigned int isPseudoTag
Definition: entry.h:53
const char * pattern
Definition: entry.h:57
unsigned int isFileEntry
Definition: entry.h:46
int(* writeEntry)(tagWriter *writer, MIO *mio, const tagEntryInfo *const tag, void *clientData)
Definition: writer_p.h:36
void vStringDelete(vString *const string)
Definition: vstring.c:60
void vStringCatS(vString *const string, const char *const s)
Definition: vstring.c:146
vString * vStringNewInit(const char *const s)
Definition: vstring.c:90
#define vStringValue(vs)
Definition: vstring.h:28
tagWriter xrefWriter
Definition: writer-xref.c:32
static int writeXrefEntry(tagWriter *writer, MIO *mio, const tagEntryInfo *const tag, void *clientData)
Definition: writer-xref.c:73
static int writeXrefPtagEntry(tagWriter *writer, MIO *mio, const ptagDesc *desc, const char *const fileName, const char *const pattern, const char *const parserName, void *clientData)
Definition: writer-xref.c:43
static tagWriter * writer
Definition: writer.c:32