[go: up one dir, main page]

File: cxref.h

package info (click to toggle)
cxref 1.4-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,392 kB
  • ctags: 1,519
  • sloc: ansic: 16,776; sh: 2,233; yacc: 1,906; lex: 377; lisp: 256; makefile: 249; perl: 70
file content (208 lines) | stat: -rw-r--r-- 6,105 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/***************************************
  $Header: /home/amb/cxref/RCS/cxref.h 1.24 1997/06/19 17:39:32 amb Exp $

  C Cross Referencing & Documentation tool. Version 1.4.

  Prototypes for general functions.
  ******************/ /******************
  Written by Andrew M. Bishop

  This file Copyright 1995,96,97 Andrew M. Bishop
  It may be distributed under the GNU Public License, version 2, or
  any higher version.  See section COPYING of the GNU Public license
  for conditions under which this file may be redistributed.
  ***************************************/


#ifndef CXREF_H
#define CXREF_H  /*+ To stop multiple inclusions. +*/

#include <stdio.h>

/* Definitions for variable / function / file types */

#define LOCAL     1      /*+ Signifies a LOCAL function / variable / include file. +*/
#define GLOBAL    2      /*+ Signifies a GLOBAL fuction / variable / include file. +*/
#define EXTERNAL  4      /*+ Signifies an EXTERNAL variable. +*/
#define EXTERN_H  8      /*+ Signifies an EXTERNAL variable seen in a header file. +*/
#define EXTERN_F 16      /*+ Signifies an EXTERNAL variable seen in a function file. +*/
#define INLINED  32      /*+ Signifies an INLINED function. +*/

/* Definitions for -xref options */

#define XREF_FILE   1    /*+ Signifies that file cross references are required. +*/
#define XREF_FUNC   2    /*+ Signifies that function cross references are required. +*/
#define XREF_VAR    4    /*+ Signifies that variable cross references are required. +*/
#define XREF_TYPE   8    /*+ Signifies that type definition cross references are required. +*/
#define XREF_ALL   15    /*+ Signifies that all the above cross references are required. +*/

/* Definitions for -warn options */

#define WARN_COMMENT  1  /*+ Signifies that warnings for commetns are required. +*/
#define WARN_XREF     2  /*+ Signifies that warnings for cross references are required. +*/
#define WARN_ALL      3  /*+ Signifies that all of the above warnings are required. +*/

/* Definitions for -index options */

#define INDEX_FILE   1   /*+ Signifies that an index of files is needed. +*/
#define INDEX_FUNC   2   /*+ Signifies that an index of global functions is needed. +*/
#define INDEX_VAR    3   /*+ Signifies that an index of global variables is needed. +*/
#define INDEX_TYPE   4   /*+ Signifies that an index of type definitions is needed. +*/
#define INDEX_ALL   15   /*+ Signifies that a complete index of all of the above is needed. +*/

/* in cxref.c */

char *CanonicaliseName(char *name);

/* In parse.l */

void ResetLexer(void);

/* In parse.y */

void ResetParser(void);

/* in file.c */

#ifdef DATA_TYPE_H
File NewFile(char* name);
void DeleteFile(File file);
#endif

void SeenFileComment(char* comment);

/* in comment.c */

void SeenComment(char* c);
char* GetCurrentComment(void);
void SetCurrentComment(char* comment);
char* SplitComment(char** original,char* name);

/* in preproc.c */

void SeenInclude(char *name);
void SeenIncludeComment(void);
void SeenFileChange(char *name,int flag);

void SeenDefine(char* name);
void SeenDefineComment(void);
void SeenDefineValue(char* value);
void SeenDefineFunctionArg(char* name);
void SeenDefineFuncArgComment(void);

void ResetPreProcAnalyser(void);
#ifdef DATA_TYPE_H
void DeleteIncludeType(Include inc);
void DeleteDefineType(Define inc);
#endif

/* in type.c */

void SeenTypedefName(char* name,int what_type);
int IsATypeName(char* name);
void SeenTypedef(char* name,char* type);

void SeenStructUnionStart(char* name);
void SeenStructUnionComp(char* name,int depth);
void SeenStructUnionEnd(void);

void ResetTypeAnalyser(void);
#ifdef DATA_TYPE_H
void DeleteTypedefType(Typedef type);
#endif

/* in var.c */

void SeenVariableDefinition(char* name,char* type,int scope);

void UpScope(void);
void DownScope(void);
void SeenScopeVariable(char* name);
int IsAScopeVariable(char* name);

void ResetVariableAnalyser(void);
#ifdef DATA_TYPE_H
void DeleteVariableType(Variable var);
#endif

/* in func.c */

void SeenFunctionProto(char* name,int in_a_function);

void SeenFunctionDeclaration(char* name,int scope);
void SeenFunctionDefinition(char* type);
void SeenFunctionArg(char* name,char* type);

void SeenFunctionCall(char* name);
void CheckFunctionVariableRef(char* name,int in_a_function);

int SeenFuncIntComment(char* comment);

void ResetFunctionAnalyser(void);
#ifdef DATA_TYPE_H
void DeleteFunctionType(Function func);
#endif

/* In slist.c */

#ifdef DATA_TYPE_H
StringList NewStringList(void);
void AddToStringList(StringList sl,char* str,int alphalist,int uniqlist);
void DeleteStringList(StringList sl);

StringList2 NewStringList2(void);
void AddToStringList2(StringList2 sl,char* str1,char* str2,int alphalist,int uniqlist);
void DeleteStringList2(StringList2 sl);
#endif

/* In xref.c */

#ifdef DATA_TYPE_H
void CrossReference(File file);
void CreateAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
#endif

void CrossReferenceDelete(char *name);

/* In warn-raw.c */

#ifdef DATA_TYPE_H
void WriteWarnRawFile(File file);
void WriteWarnRawAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
#endif

/* In latex.c */

#ifdef DATA_TYPE_H
void WriteLatexFile(File file);
void WriteLatexAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
#endif

void WriteLatexFileDelete(char *name);

/* In html.c */

#ifdef DATA_TYPE_H
void WriteHTMLFile(File file);
void WriteHTMLAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
#endif

void WriteHTMLFileDelete(char *name);

/* Not defined on Suns */

#if defined(__sun__) && !defined(__svr4__)
int fputs(const char *s, FILE *stream);
int fprintf(FILE*, const char*,...);
int pclose( FILE *stream);
int fscanf( FILE *stream, const char *format, ...);
int fclose(FILE*);
int rename(const char *oldpath, const char *newpath);
int printf(const char*,...);
int fwrite(const void*,unsigned int,unsigned int, FILE*);
int fread(void*,unsigned int,unsigned int, FILE*);
int isatty(int desc);
int fflush( FILE *stream);
#endif

#endif /* CXREF_H */