[gcalctool/gcalctool-newui2: 1/3] Added mp-equation-private.h
- From: Robert Ancell <rancell src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gcalctool/gcalctool-newui2: 1/3] Added mp-equation-private.h
- Date: Thu, 17 Sep 2009 23:15:31 +0000 (UTC)
commit 55078851d3535812c7193bd8597f20e57b02cba9
Author: Robert Ancell <robert ancell gmail com>
Date: Thu Sep 17 11:53:54 2009 +1000
Added mp-equation-private.h
src/mp-equation-private.h | 55 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/src/mp-equation-private.h b/src/mp-equation-private.h
new file mode 100644
index 0000000..16bf6ec
--- /dev/null
+++ b/src/mp-equation-private.h
@@ -0,0 +1,55 @@
+
+/* $Header$
+ *
+ * Copyright (C) 2004-2008 Sami Pietila
+ * Copyright (c) 2008-2009 Robert Ancell
+ *
+ * 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, 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., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef MP_EQUATION_PRIVATE_H
+#define MP_EQUATION_PRIVATE_H
+
+#include "mp-equation.h"
+
+typedef struct MPEquationParserState MPEquationParserState;
+
+/* State for parser */
+struct MPEquationParserState {
+ /* User provided options */
+ MPEquationOptions *options;
+
+ /* Function to get variable values */
+ int (*get_variable)(MPEquationParserState *state, const char *name, MPNumber *z);
+
+ /* Function to set variable values */
+ void (*set_variable)(MPEquationParserState *state, const char *name, const MPNumber *x);
+
+ /* Function to solve functions */
+ int (*get_function)(MPEquationParserState *state, const char *name, const MPNumber *x, MPNumber *z);
+
+ // FIXME: get_operator??
+
+ /* Error returned from parser */
+ int error;
+
+ /* Value returned from parser */
+ MPNumber ret;
+};
+
+int _mp_equation_error(void *yylloc, MPEquationParserState *state, char *text);
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]