Imported Upstream version 15.8a
[platform/upstream/cscope.git] / src / build.h
1 /*===========================================================================
2  Copyright (c) 2001, The Santa Cruz Operation 
3  All rights reserved.
4  
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7
8  *Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10
11  *Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14
15  *Neither name of The Santa Cruz Operation nor the names of its contributors
16  may be used to endorse or promote products derived from this software
17  without specific prior written permission. 
18
19  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
20  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
23  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  INTERRUPTION)
27  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30  DAMAGE. 
31  =========================================================================*/
32
33 /* $Id: build.h,v 1.1 2001/07/09 14:01:18 broeker Exp $ */
34
35
36 #ifndef CSCOPE_BUILD_H
37 #define CSCOPE_BUILD_H
38
39 #include "global.h"             /* FIXME: temp. only */
40 #include "invlib.h"
41
42 /* types and macros of build.c to be used by other modules */
43
44 /* database output macros that update its offset */
45 #define dbputc(c)       (++dboffset, (void) putc(c, newrefs))
46 #define dbfputs(s)      (dboffset += strlen(s), fputs(s, newrefs))
47
48 /* declarations for globals defined in build.c */
49
50 extern  BOOL    buildonly;      /* only build the database */
51 extern  BOOL    unconditional;  /* unconditionally build database */
52 extern  BOOL    fileschanged;   /* assume some files changed */
53
54 extern  char    *reffile;       /* cross-reference file path name */
55 extern  char    *invname;       /* inverted index to the database */
56 extern  char    *invpost;       /* inverted index postings */
57 extern  char    *newreffile;    /* new cross-reference file name */
58 extern  FILE    *newrefs;       /* new cross-reference */
59 extern  FILE    *postings;      /* new inverted index postings */
60 extern  int     symrefs;        /* cross-reference file */
61
62 extern  INVCONTROL invcontrol;  /* inverted file control structure */
63
64 /* Prototypes of external functions defined by build.c */
65
66 void    build(void);
67 void    free_newbuildfiles(void);
68 void    opendatabase(void);
69 void    rebuild(void);
70 void    setup_build_filenames(char *reffile);
71 void    seek_to_trailer(FILE *f);
72
73 #endif /* CSCOPE_BUILD_H */