Subversion Repositories filter_foundry

Rev

Rev 185 | Rev 194 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 185 Rev 192
1
/*
1
/*
2
    This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop
2
    This file is part of "Filter Foundry", a filter plugin for Adobe Photoshop
3
    Copyright (C) 2003-2019 Toby Thain, toby@telegraphics.com.au
3
    Copyright (C) 2003-2009 Toby Thain, toby@telegraphics.com.au
-
 
4
    Copyright (C) 2018-2019 Daniel Marschall, ViaThinkSoft
4
 
5
 
5
    This program is free software; you can redistribute it and/or modify
6
    This program is free software; you can redistribute it and/or modify
6
    it under the terms of the GNU General Public License as published by
7
    it under the terms of the GNU General Public License as published by
7
    the Free Software Foundation; either version 2 of the License, or
8
    the Free Software Foundation; either version 2 of the License, or
8
    (at your option) any later version.
9
    (at your option) any later version.
9
 
10
 
10
    This program is distributed in the hope that it will be useful,
11
    This program is distributed in the hope that it will be useful,
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
    GNU General Public License for more details.
14
    GNU General Public License for more details.
14
 
15
 
15
    You should have received a copy of the GNU General Public License
16
    You should have received a copy of the GNU General Public License
16
    along with this program; if not, write to the Free Software
17
    along with this program; if not, write to the Free Software
17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
*/
19
*/
19
 
20
 
20
#ifndef SYMTAB_H
21
#ifndef SYMTAB_H
21
#define SYMTAB_H
22
#define SYMTAB_H
22
 
23
 
23
#include <stdlib.h>
24
#include <stdlib.h>
24
 
25
 
25
#define NEW(P) ( (P) = malloc(sizeof(*(P))) )
26
#define NEW(P) ( (P) = malloc(sizeof(*(P))) )
26
 
27
 
27
/* if this type is floating point, then #define FP_VALUE */
28
/* if this type is floating point, then #define FP_VALUE */
28
#ifdef FP_VALUE
29
#ifdef FP_VALUE
29
typedef double value_type;
30
typedef double value_type;
30
#else
31
#else
31
typedef long value_type;
32
typedef long value_type;
32
#endif
33
#endif
33
typedef value_type (*pfunc_type)(value_type,...);
34
typedef value_type (*pfunc_type)(value_type,...);
34
 
35
 
35
struct sym_rec{
36
struct sym_rec{
36
        struct sym_rec *next;
37
        struct sym_rec *next;
37
        int token;
38
        int token;
38
        char *name;
39
        char *name;
39
 
40
 
40
        pfunc_type fn;
41
        pfunc_type fn;
41
        value_type *pvar;
42
        value_type *pvar;
42
};
43
};
43
 
44
 
44
unsigned long djb2(char *str);
45
unsigned long djb2(char *str);
45
struct sym_rec *lookup(char *s);
46
struct sym_rec *lookup(char *s);
46
void init_symtab(struct sym_rec *);
47
void init_symtab(struct sym_rec *);
47
void insert(struct sym_rec *p);
48
void insert(struct sym_rec *p);
48
void dump_symbols();
49
void dump_symbols();
49
 
50
 
50
#endif
51
#endif
51
 
52