-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathexpression_db.h
79 lines (65 loc) · 2.1 KB
/
expression_db.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/* -*- c -*- */
/*
* expression_db.h
*
* MathMap
*
* Copyright (C) 2007-2008 Mark Probst
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __EXPRESSION_DB_H__
#define __EXPRESSION_DB_H__
#include "userval.h"
#include "designer/designer.h"
#define EXPRESSION_DB_EXPRESSION 1
#define EXPRESSION_DB_DESIGN 2
#define EXPRESSION_DB_GROUP 3
struct _mathmap_t;
typedef struct _expression_db_t
{
char *name;
int kind;
union
{
struct
{
char *path;
char *docstring;
struct _mathmap_t *mathmap;
} expression;
struct
{
char *path;
struct _mathmap_t *mathmap;
} design;
struct
{
struct _expression_db_t *subs;
} group;
} v;
struct _expression_db_t *next;
} expression_db_t;
extern expression_db_t* read_expression_db (char *path);
extern void free_expression_db (expression_db_t *edb);
extern expression_db_t* copy_expression_db (expression_db_t *edb);
extern expression_db_t* make_expression_db_group (const char *name, expression_db_t *subs);
extern char* read_expression (const char *path);
extern char* get_expression_docstring (expression_db_t *edb);
extern expression_db_t* merge_expression_dbs (expression_db_t *edb1, expression_db_t *edb2);
extern char* get_expression_name (expression_db_t *expr, designer_design_type_t *design_type);
extern userval_info_t* get_expression_args (expression_db_t *expr, designer_design_type_t *design_type);
extern char* get_expression_path (expression_db_t *expr);
#endif