Main Page
Classes
Files
File List
File Members
auxlib
formula-calc
include
formula.h
Go to the documentation of this file.
1
// Simple mathematical formula processing library
2
// Written by Atsushi Watanabe
3
// Intelligent Robot Laboratory, University of Tsukuba
4
//
5
// Copyright 2011 Atsushi Watanabe, All rights reserved.
6
//
7
// Redistribution and use in source and binary forms, with or without
8
// modification, are permitted provided that the following conditions are met:
9
//
10
// * Redistributions of source code must retain the above copyright notice, this
11
// list of conditions and the following disclaimer.
12
// * Redistributions in binary form must reproduce the above copyright notice,
13
// this list of conditions and the following disclaimer in the documentation
14
// and/or other materials provided with the distribution.
15
//
16
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
17
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19
// EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
#ifndef FORMULA_H
28
#define FORMULA_H
29
30
#include <
formula-calc.h
>
31
32
struct
stack_t
33
{
34
int
rank
;
35
enum
rpf_type_t
type
;
36
void
*
value
;
37
};
38
39
struct
operation_t
40
{
41
char
op[8];
42
int
rank
;
43
enum
rpf_type_t
type
;
44
double (*func)(
double
**);
45
int
narg
;
46
};
47
48
struct
rpf_t
*
rpf_push
(
struct
rpf_t
*rpf,
struct
stack_t
*obj);
49
struct
rpf_t
*
rpf_join
(
struct
rpf_t
*rpf,
struct
rpf_t
*rpf2);
50
int
rpf_count_num
(
struct
rpf_t
*rpf);
51
struct
rpf_t
*
rpf_last
(
struct
rpf_t
*rpf);
52
struct
rpf_t
*
formula_output
(
struct
stack_t
*num,
int
*sp_num,
struct
stack_t
*op,
int
*sp_op,
int
rank
);
53
54
#endif // FORMULA_H
operation_t::rank
int rank
Definition:
formula.h:42
operation_t::narg
int narg
Definition:
formula.h:45
formula-calc.h
rpf_type_t
rpf_type_t
Definition:
formula-calc.h:39
stack_t
Definition:
formula.h:32
rpf_push
struct rpf_t * rpf_push(struct rpf_t *rpf, struct stack_t *obj)
Definition:
libformula-calc.c:263
rpf_count_num
int rpf_count_num(struct rpf_t *rpf)
Definition:
libformula-calc.c:282
operation_t
Definition:
formula.h:39
formula_output
struct rpf_t * formula_output(struct stack_t *num, int *sp_num, struct stack_t *op, int *sp_op, int rank)
Definition:
libformula-calc.c:295
stack_t::rank
int rank
Definition:
formula.h:34
rpf_t
Definition:
formula-calc.h:50
stack_t::value
void * value
Definition:
formula.h:36
stack_t::type
enum rpf_type_t type
Definition:
formula.h:35
rpf_join
struct rpf_t * rpf_join(struct rpf_t *rpf, struct rpf_t *rpf2)
Definition:
libformula-calc.c:273
rpf_last
struct rpf_t * rpf_last(struct rpf_t *rpf)
Definition:
libformula-calc.c:255
yp-spur
Author(s):
autogenerated on Sat May 11 2019 02:08:24