Initial import from FreeBSD RELENG_4:
[dragonfly.git] / gnu / usr.bin / as / frags.h
1 /* frags.h - Header file for the frag concept.
2
3    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
4
5    This file is part of GAS, the GNU Assembler.
6
7    GAS is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2, or (at your option)
10    any later version.
11
12    GAS is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GAS; see the file COPYING.  If not, write to
19    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20 /*
21  * $FreeBSD: src/gnu/usr.bin/as/frags.h,v 1.6 1999/08/27 23:34:16 peter Exp $
22  */
23
24
25 extern struct obstack   frags;
26 /* Frags ONLY live in this obstack. */
27 /* We use obstack_next_free() macro */
28 /* so please don't put any other objects */
29 /* on this stack! */
30
31 /*
32  * A macro to speed up appending exactly 1 char
33  * to current frag.
34  */
35 /* JF changed < 1 to <= 1 to avoid a race conditon */
36 #define FRAG_APPEND_1_CHAR(datum)       \
37 {                                       \
38                                             if (obstack_room( &frags ) <= 1) {\
39                                                                                   frag_wane (frag_now); \
40                                                                                       frag_new (0);             \
41                                                                                   }                             \
42                                                                                       obstack_1grow( &frags, datum );   \
43                                                                                   }
44
45
46 #if __STDC__ == 1
47
48 char *frag_more(int nchars);
49 void frag_align(int alignment, int fill_character);
50 void frag_new(int old_frags_var_max_size);
51 void frag_wane(fragS *fragP);
52
53 char *frag_variant(relax_stateT type,
54                    int max_chars,
55                    int var,
56                    relax_substateT subtype,
57                    symbolS *symbol,
58                    long offset,
59                    char *opcode,
60                    int pcrel_adjust,
61                    int bsr);
62
63 char *frag_var(relax_stateT type,
64                int max_chars,
65                int var,
66                relax_substateT subtype,
67                symbolS *symbol,
68                long offset,
69                char *opcode);
70
71 #else /* not __STDC__ */
72
73 char *frag_more();
74 char *frag_var();
75 char *frag_variant();
76 void frag_align();
77 void frag_new();
78 void frag_wane();
79
80 #endif /* not __STDC__ */
81
82 /*
83  * Local Variables:
84  * comment-column: 0
85  * fill-column: 131
86  * End:
87  */
88
89 /* end of frags.h */