Add release timetable to CONTRIBUTING file
[linux-libre-firmware.git] / a56 / a56.h
1 /*******************************************************
2  *
3  *  a56 - a DSP56001 assembler
4  *
5  *  Written by Quinn C. Jensen
6  *  July 1990
7  *
8  *******************************************************\
9
10 /*
11  * Copyright (C) 2008 Robert Millan <rmh@aybabtu.com>
12  * Copyright (C) 2012 Thorsten Alteholz <debian@alteholz.de>
13  *
14  * This file is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published
16  * by the Free Software Foundation, either version 3 of the License,
17  * or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program. If not, see
26  * <http://www.gnu.org/licenses/>.
27  *
28  * This file incorporates work covered by the following copyright and
29  * permission notice:
30  *
31  * Copyright (C) 1990-1994 Quinn C. Jensen
32  *
33  * Permission to use, copy, modify, distribute, and sell this software
34  * and its documentation for any purpose is hereby granted without fee,
35  * provided that the above copyright notice appear in all copies and
36  * that both that copyright notice and this permission notice appear
37  * in supporting documentation.  The author makes no representations
38  * about the suitability of this software for any purpose.  It is
39  * provided "as is" without express or implied warranty.
40  *
41  */
42
43 /*
44  *  a56.h - general definitions
45  *
46  */
47
48 #include <stdio.h>
49 #include <stdlib.h>
50 #include <string.h>
51
52 #ifndef TRUE
53 #define TRUE 1
54 #define FALSE 0
55 #define NOT !
56 typedef int BOOL;
57 #endif
58
59 struct sym {
60         char *name;
61         struct n {
62                 short type;
63 #define UNDEF -1
64 #define INT 0
65 #define FLT 1
66                 short seg;
67 #define NONE 0
68 #define PROG 1
69 #define XDATA 2
70 #define YDATA 3
71 #define LDATA 4
72 #define ANY 5
73                 union val {
74                         int i;
75                         double f;
76                 } val;
77         } n;
78         struct sym *next;
79 } *find_sym();
80
81 extern int pass;
82
83 #define NEW(object) ((object *)alloc(sizeof(object)))
84
85 #define MAX_NEST 20             /* maximum include file nesting */
86
87 struct inc {
88         char *file;
89         FILE *fp;
90         int line;
91 };
92 extern struct inc inc[];
93 extern int inc_p;
94 #define curfile inc[inc_p].file
95 #define curline inc[inc_p].line
96
97 extern int ldebug;
98
99 struct psect {
100         char *name;
101         int seg;
102         unsigned int pc, bottom, top;
103         struct psect *next;
104 } *find_psect(), *new_psect();
105
106 FILE *open_read(), *open_write(), *open_append();
107
108         /* save string s somewhere */
109 #define strsave(s) ((s) != NULL ? \
110                 (char *)strcpy((char *)malloc(strlen(s)+1),(s)) : NULL)
111
112         /* after a call to fgets(), remove the newline character */
113 #define rmcr(s) {if (s[strlen(s)-1] == '\n') s[strlen(s)-1] = '\0';};
114
115 #define ASSERT(expr, str) \
116                 if(expr) fprintf(stderr, "ASSERT: %s: line %d: %s\n", __FILE__, __LINE__, str);
117
118 char *alloc (int size);
119 char *fixstring (char *s);