Update of /cvsroot/monetdb/clients/src/examples/C
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7148/C
Modified Files:
smack00.c smack01.c
Log Message:
add support for mal in smack tests
Index: smack00.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/smack00.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- smack00.c 3 Oct 2007 13:56:14 -0000 1.5
+++ smack00.c 24 Oct 2007 08:50:19 -0000 1.6
@@ -47,6 +47,7 @@
int i, port;
char buf[40];
int lang = 0;
+ char *l = "mil";
/* char *line; */
@@ -55,14 +56,17 @@
exit(-1);
}
if (argc == 3) {
+ l = argv[2];
if (strcmp(argv[2], "sql") == 0)
lang = 1;
else if (strcmp(argv[2], "xquery") == 0)
lang = 2;
+ else if (strcmp(argv[2], "mal") == 0)
+ lang = 3;
}
port = atol(argv[1]);
- dbh = mapi_connect("localhost", port, "monetdb", "monetdb", (lang==0) ?
NULL : (lang==1)? "sql": "xquery", NULL);
+ dbh = mapi_connect("localhost", port, "monetdb", "monetdb", l, NULL);
if (dbh == NULL || mapi_error(dbh))
die(dbh, hdl);
@@ -75,6 +79,8 @@
snprintf(buf, 40, "%d", i);
else if (lang==1)
snprintf(buf, 40, "select %d;", i);
+ else if (lang==3)
+ snprintf(buf, 40, "io.print(%d);", i);
else
snprintf(buf, 40, "print(%d);", i);
if ((hdl = mapi_query(dbh, buf)) == NULL || mapi_error(dbh))
Index: smack01.c
===================================================================
RCS file: /cvsroot/monetdb/clients/src/examples/C/smack01.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- smack01.c 3 Oct 2007 13:56:15 -0000 1.5
+++ smack01.c 24 Oct 2007 08:50:19 -0000 1.6
@@ -48,21 +48,25 @@
char buf[40], *line;
int port;
int lang = 0;
+ char *l = "mil";
if (argc != 2 && argc != 3) {
printf("usage: smack01 <port> [<language>]\n");
exit(-1);
}
if (argc == 3) {
+ l = argv[2];
if (strcmp(argv[2], "sql") == 0)
lang = 1;
else if (strcmp(argv[2], "xquery") == 0)
lang = 2;
+ else if (strcmp(argv[2], "mal") == 0)
+ lang = 3;
}
port = atol(argv[1]);
- dbh = mapi_connect("localhost", port, "monetdb", "monetdb", (lang==0) ?
NULL : (lang==1)? "sql": "xquery", NULL);
+ dbh = mapi_connect("localhost", port, "monetdb", "monetdb", l, NULL);
for (i = 0; i < 1000; i++) {
/* printf("setup connection %d\n", i); */
mapi_reconnect(dbh);
@@ -77,6 +81,8 @@
snprintf(buf, 40, "%d", i);
else if (lang==1)
snprintf(buf, 40, "select %d;", i);
+ else if (lang==3)
+ snprintf(buf, 40, "io.print(%d);", i);
else
snprintf(buf, 40, "print(%d);", i);
if ((hdl = mapi_query(dbh, buf)) == NULL || mapi_error(dbh))
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins