|
|
|
Index: backend/Makefile.in
|
|
|
|
--- backend/Makefile.in.orig 2006-10-10 09:53:36 +0200
|
|
|
|
+++ backend/Makefile.in 2007-01-06 10:46:22 +0100
|
|
|
|
@@ -116,7 +116,7 @@
|
|
|
|
|
|
|
|
papyrus_backend_SOURCES = backend.c $(libpapyrus_backend_la_SOURCES)
|
|
|
|
papyrus_backend_LDFLAGS = -rdynamic @LDFLAGS@ @GLIB_CFLAGS@
|
|
|
|
-papyrus_backend_LDADD = -ldl -L../common -lpapyrus_common -L../equation -lpapyrus_equation @GLIB_LIBS@ @LDFLAGS@ @PQ_LIBS@ @MYSQL_LIBS@ @ORACLE_LIBS@ @LIBGDA_LIBS@
|
|
|
|
+papyrus_backend_LDADD = -L../common -lpapyrus_common -L../equation -lpapyrus_equation @GLIB_LIBS@ @LDFLAGS@ @PQ_LIBS@ @MYSQL_LIBS@ @ORACLE_LIBS@ @LIBGDA_LIBS@
|
|
|
|
|
|
|
|
|
|
|
|
libpapyrus_binding_pg_la_SOURCES = binding_pg.c
|
|
|
|
Index: backend/binding_gda.c
|
|
|
|
--- backend/binding_gda.c.orig 2006-10-10 09:53:36 +0200
|
|
|
|
+++ backend/binding_gda.c 2007-01-06 10:51:45 +0100
|
|
|
|
@@ -27,6 +27,7 @@
|
|
|
|
GdaCommand *command;
|
|
|
|
GdaConnection *conn = connection;
|
|
|
|
GdaDataModel *dm;
|
|
|
|
+ GError *error;
|
|
|
|
|
|
|
|
if (!conn) {
|
|
|
|
errormsg("Invalid connection");
|
|
|
|
@@ -42,7 +43,7 @@
|
|
|
|
GDA_COMMAND_TYPE_SQL,
|
|
|
|
GDA_COMMAND_OPTION_STOP_ON_ERRORS);
|
|
|
|
|
|
|
|
- dm = gda_connection_execute_single_command(conn, command, NULL);
|
|
|
|
+ dm = gda_connection_execute_select_command(conn, command, NULL, &error);
|
|
|
|
|
|
|
|
if (!dm) {
|
|
|
|
g_error("LibGda error returning data model from SQL query");
|
|
|
|
@@ -130,13 +131,28 @@
|
|
|
|
return (q->cur_record <= (pap_query_length(query) - 1));
|
|
|
|
}
|
|
|
|
|
|
|
|
+static gint OLD_gda_data_model_get_column_position(GdaDataModel *model, gchar *field)
|
|
|
|
+{
|
|
|
|
+ const gchar *title;
|
|
|
|
+ gint fieldno;
|
|
|
|
+
|
|
|
|
+ for (fieldno = 0; fieldno < 100; fieldno++) {
|
|
|
|
+ title = gda_data_model_get_column_title(model, fieldno);
|
|
|
|
+ if (strcmp(title, field) == 0)
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if (fieldno == 100)
|
|
|
|
+ fieldno = 0;
|
|
|
|
+ return fieldno;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
gchar *
|
|
|
|
pap_query_get_value(void *query, gchar *field)
|
|
|
|
{
|
|
|
|
gda_query *q = query;
|
|
|
|
gint fieldno;
|
|
|
|
gchar *retval;
|
|
|
|
- GdaValue *value;
|
|
|
|
+ GValue *value;
|
|
|
|
|
|
|
|
if (q == NULL || q->res == NULL) {
|
|
|
|
errormsg("Invalid query recordset");
|
|
|
|
@@ -148,13 +164,13 @@
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
- fieldno = gda_data_model_get_column_position(q->res, field);
|
|
|
|
+ fieldno = OLD_gda_data_model_get_column_position(q->res, field);
|
|
|
|
if (fieldno == -1) {
|
|
|
|
errormsg("Invalid field: %s in query %s", field, q->string);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
- value = (GdaValue *)gda_data_model_get_value_at(q->res, fieldno, q->cur_record);
|
|
|
|
+ value = (GValue *)gda_data_model_get_value_at(q->res, fieldno, q->cur_record);
|
|
|
|
if (!value) {
|
|
|
|
g_error("Failed to get value at row %d, col %d", q->cur_record, fieldno);
|
|
|
|
return NULL;
|
|
|
|
@@ -177,6 +193,7 @@
|
|
|
|
GdaConnection *conn;
|
|
|
|
GdaClient *client;
|
|
|
|
gchar *newconnectstr;
|
|
|
|
+ GError *error;
|
|
|
|
|
|
|
|
client = gda_client_new();
|
|
|
|
|
|
|
|
@@ -187,7 +204,8 @@
|
|
|
|
conn = gda_client_open_connection_from_string(client,
|
|
|
|
provider,
|
|
|
|
newconnectstr,
|
|
|
|
- GDA_CONNECTION_OPTIONS_READ_ONLY);
|
|
|
|
+ NULL, NULL,
|
|
|
|
+ GDA_CONNECTION_OPTIONS_READ_ONLY, &error);
|
|
|
|
|
|
|
|
if (!GDA_IS_CONNECTION(conn)) {
|
|
|
|
g_error("Could not open connection from string `%s', using provider `%s'",
|
|
|
|
Index: backend/convert.c
|
|
|
|
--- backend/convert.c.orig 2006-10-10 09:53:36 +0200
|
|
|
|
+++ backend/convert.c 2007-01-06 10:46:11 +0100
|
|
|
|
@@ -618,6 +618,9 @@
|
|
|
|
xmlNodePtr child;
|
|
|
|
char *old, *eq_str = NULL;
|
|
|
|
char *data;
|
|
|
|
+#ifndef INFINITY
|
|
|
|
+#define INFINITY 99999999
|
|
|
|
+#endif
|
|
|
|
double retval = INFINITY;
|
|
|
|
|
|
|
|
for (child = equation->children; child != NULL; child = child->next)
|
|
|
|
Index: equation/lexer.l
|
|
|
|
--- equation/lexer.l.orig 2006-10-10 09:53:35 +0200
|
|
|
|
+++ equation/lexer.l 2007-01-06 10:46:11 +0100
|
|
|
|
@@ -3,24 +3,18 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <math.h>
|
|
|
|
-#ifndef WIN32
|
|
|
|
-#include <bits/nan.h>
|
|
|
|
-#else
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
#include "parser.h"
|
|
|
|
|
|
|
|
-double strtod(const char *nptr, char **endptr);
|
|
|
|
-
|
|
|
|
%}
|
|
|
|
|
|
|
|
%option noyywrap
|
|
|
|
%option yylineno
|
|
|
|
%%
|
|
|
|
-[0-9]* { eqnlval.d = strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
-[0-9]*\.[0-9]+ { eqnlval.d = strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
-[0-9]+\.[0-9]* { eqnlval.d = strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
-"NaN" { eqnlval.d = NAN; return NUMBER;}
|
|
|
|
+[0-9]* { eqnlval.d = (double)strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
+[0-9]*\.[0-9]+ { eqnlval.d = (double)strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
+[0-9]+\.[0-9]* { eqnlval.d = (double)strtod (eqntext, NULL); return NUMBER; }
|
|
|
|
+"NaN" { eqnlval.d = __builtin_nan(""); return NUMBER;}
|
|
|
|
"lt" { return '<';}
|
|
|
|
"gt" { return '>';}
|
|
|
|
[a-zA-Z_]+ { eqnlval.string = g_strdup (eqntext); return STRING; }
|
|
|
|
Index: html/xml2html.c
|
|
|
|
--- html/xml2html.c.orig 2006-10-10 09:53:36 +0200
|
|
|
|
+++ html/xml2html.c 2007-01-06 10:46:11 +0100
|
|
|
|
@@ -220,7 +220,8 @@
|
|
|
|
/* Calculate size of number. e.g. "123cm" would be 3 and
|
|
|
|
"12345cm" would be 5 */
|
|
|
|
for (i = 0; i < str_size && isdigit(size[i]); i++);
|
|
|
|
- num_str = strndup(size, i);
|
|
|
|
+ num_str = strdup(size);
|
|
|
|
+ num_str[i] = '\0';
|
|
|
|
|
|
|
|
for (i = 0; i < atoi(size); i++) {
|
|
|
|
fputs("<BR>", output);
|
|
|
|
@@ -240,7 +241,8 @@
|
|
|
|
/* Calculate size of number. e.g. "123cm" would be 3 and
|
|
|
|
"12345cm" would be 5 */
|
|
|
|
for (i = 0; i < str_size && isdigit(size[i]); i++);
|
|
|
|
- num_str = strndup(size, i);
|
|
|
|
+ num_str = strdup(size);
|
|
|
|
+ num_str[i] = '\0';
|
|
|
|
|
|
|
|
for (i = 0; i < atoi(size); i++) {
|
|
|
|
fputs(" ", output);
|