revert between 56095 -> 55830 in arch
[AROS.git] / tools / cxref / cxref.h
blobacca82209e42c82e4b2fde06b2df7c67f8c6272f
1 /***************************************
2 $Header$
4 C Cross Referencing & Documentation tool. Version 1.5c.
6 Prototypes for general functions.
7 ******************/ /******************
8 Written by Andrew M. Bishop
10 This file Copyright 1995,96,97,98,99 Andrew M. Bishop
11 It may be distributed under the GNU Public License, version 2, or
12 any higher version. See section COPYING of the GNU Public license
13 for conditions under which this file may be redistributed.
14 ***************************************/
17 #ifndef CXREF_H
18 #define CXREF_H /*+ To stop multiple inclusions. +*/
20 #include "datatype.h"
22 /* Definitions for variable / function / file types */
24 #define LOCAL 1 /*+ Signifies a LOCAL function / variable / include file. +*/
25 #define GLOBAL 2 /*+ Signifies a GLOBAL fuction / variable / include file. +*/
26 #define EXTERNAL 4 /*+ Signifies an EXTERNAL variable. +*/
27 #define EXTERN_H 8 /*+ Signifies an EXTERNAL variable seen in a header file. +*/
28 #define EXTERN_F 16 /*+ Signifies an EXTERNAL variable seen in a function file. +*/
29 #define INLINED 32 /*+ Signifies an INLINED function. +*/
31 /* Definitions for -xref options */
33 #define XREF_FILE 1 /*+ Signifies that file cross references are required. +*/
34 #define XREF_FUNC 2 /*+ Signifies that function cross references are required. +*/
35 #define XREF_VAR 4 /*+ Signifies that variable cross references are required. +*/
36 #define XREF_TYPE 8 /*+ Signifies that type definition cross references are required. +*/
37 #define XREF_ALL 15 /*+ Signifies that all the above cross references are required. +*/
39 /* Definitions for -warn options */
41 #define WARN_COMMENT 1 /*+ Signifies that warnings for commetns are required. +*/
42 #define WARN_XREF 2 /*+ Signifies that warnings for cross references are required. +*/
43 #define WARN_ALL 3 /*+ Signifies that all of the above warnings are required. +*/
45 /* Definitions for -index options */
47 #define INDEX_FILE 1 /*+ Signifies that an index of files is needed. +*/
48 #define INDEX_FUNC 2 /*+ Signifies that an index of global functions is needed. +*/
49 #define INDEX_VAR 3 /*+ Signifies that an index of global variables is needed. +*/
50 #define INDEX_TYPE 4 /*+ Signifies that an index of type definitions is needed. +*/
51 #define INDEX_ALL 15 /*+ Signifies that a complete index of all of the above is needed. +*/
53 /* in cxref.c */
55 char *CanonicaliseName(char *name);
57 /* In parse.l */
59 void ResetLexer(void);
61 /* In parse.y */
63 void ResetParser(void);
65 /* in file.c */
67 File NewFile(char* name);
68 void DeleteFile(File file);
70 void SeenFileComment(char* comment);
72 /* in comment.c */
74 void SeenComment(char* c,int flag);
75 char* GetCurrentComment(void);
76 void SetCurrentComment(char* comment);
77 char* SplitComment(char** original,char* name);
78 void DeleteComment(void);
80 /* in preproc.c */
82 void SeenInclude(char *name);
83 void SeenIncludeComment(void);
84 char *SeenFileChange(char *name,int flag);
86 void SeenDefine(char* name);
87 void SeenDefineComment(void);
88 void SeenDefineValue(char* value);
89 void SeenDefineFunctionArg(char* name);
90 void SeenDefineFuncArgComment(void);
92 void ResetPreProcAnalyser(void);
93 void DeleteIncludeType(Include inc);
94 void DeleteDefineType(Define inc);
96 /* in type.c */
98 void SeenTypedefName(char* name,int what_type);
99 int IsATypeName(char* name);
100 void SeenTypedef(char* name,char* type);
102 void SeenStructUnionStart(char* name);
103 void SeenStructUnionComp(char* name,int depth);
104 void SeenStructUnionEnd(void);
106 void ResetTypeAnalyser(void);
107 void DeleteTypedefType(Typedef type);
109 /* in var.c */
111 void SeenVariableDefinition(char* name,char* type,int scope);
113 void UpScope(void);
114 void DownScope(void);
115 void SeenScopeVariable(char* name);
116 int IsAScopeVariable(char* name);
118 void ResetVariableAnalyser(void);
119 void DeleteVariableType(Variable var);
121 /* in func.c */
123 void SeenFunctionProto(char* name,int in_a_function);
125 void SeenFunctionDeclaration(char* name,int scope);
126 void SeenFunctionDefinition(char* type);
127 void SeenFunctionArg(char* name,char* type);
129 void SeenFunctionCall(char* name);
130 void CheckFunctionVariableRef(char* name,int in_a_function);
132 int SeenFuncIntComment(char* comment);
134 void ResetFunctionAnalyser(void);
135 void DeleteFunctionType(Function func);
137 /* In slist.c */
139 StringList NewStringList(void);
140 void AddToStringList(StringList sl,char* str,int alphalist,int uniqlist);
141 void DeleteStringList(StringList sl);
143 StringList2 NewStringList2(void);
144 void AddToStringList2(StringList2 sl,char* str1,char* str2,int alphalist,int uniqlist);
145 void DeleteStringList2(StringList2 sl);
147 /* In xref.c */
149 void CrossReference(File file,int outputs);
150 void CreateAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
152 void CrossReferenceDelete(char *name);
154 /* In warn-raw.c */
156 void WriteWarnRawFile(File file);
157 void WriteWarnRawAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
159 int CopyOrSkip(char *string,char *type,int *copy,int *skip);
161 /* In latex.c */
163 void WriteLatexFile(File file);
164 void WriteLatexAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
166 void WriteLatexFileDelete(char *name);
168 /* In html.c */
170 void WriteHTMLFile(File file);
171 void WriteHTMLAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
173 void WriteHTMLFileDelete(char *name);
175 /* In rtf.c */
177 void WriteRTFFile(File file);
178 void WriteRTFAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
180 void WriteRTFFileDelete(char *name);
182 /* In sgml.c */
184 void WriteSGMLFile(File file);
185 void WriteSGMLAppendix(StringList files,StringList2 funcs,StringList2 vars,StringList2 types);
187 void WriteSGMLFileDelete(char *name);
190 /* Not defined on Suns */
192 #if defined(__sun__) && !defined(__svr4__)
193 #include <stdio.h>
195 int fputs(const char *s, FILE *stream);
196 int fprintf(FILE*, const char*,...);
197 int pclose( FILE *stream);
198 int fscanf( FILE *stream, const char *format, ...);
199 int fclose(FILE*);
200 int rename(const char *oldpath, const char *newpath);
201 int printf(const char*,...);
202 int fwrite(const void*,unsigned int,unsigned int, FILE*);
203 int fread(void*,unsigned int,unsigned int, FILE*);
204 int isatty(int desc);
205 int fflush( FILE *stream);
206 #endif /* Suns */
208 #endif /* CXREF_H */