Re: patch, problems, question
Bob Doan <bdoan-J0aWFLYJOWhWk0Htik3J/[email protected]> Fri, 13 May 2005 17:55:13 -0400
| Newsgroups | gmane.text.rlib.user |
|---|---|
| Message-ID | <[email protected]> |
Attached is an untested patch which should fix the problem
let me know
- bob
On Fri, 2005-05-13 at 17:30 -0400, Shannon Weyrick wrote:
> >
> > And then in the XML do:
> >
> > <field value="bobdoan(mikeroth('bacon', 'eggs'))" width="50"/>
> >
> > http://www.sicom.com/~bdoan/rlib-1.3.4.tar.gz
> >
> > see src/examples/php/array[xml|php] as an example
> >
> > - Bob
>
> Hey Bob,
>
> Quick (hopefully) simple bug: the arguments are showing up to the PHP
> function in the reverse order. In your example, one would expect it to
> show up as "Bacon and Eggs" in the output but in fact it shows up "Eggs
> and Bacon".
>
> Other than that it looks great, thanks a lot.
>
> Shannon
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Oracle Space Sweepstakes
> Want to be the first software developer in space?
> Enter now for the Oracle Space Sweepstakes!
> http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
> _______________________________________________
> Rlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rlib-users
--
Bob Doan <bdoan-J0aWFLYJOWhWk0Htik3J/[email protected]>
fix.patch
(text/x-patch, 2.4 KB)
Index: bindings/php/php.c
===================================================================
RCS file: /cvsroot/rlib/rlib/bindings/php/php.c,v
retrieving revision 1.35
diff -u -r1.35 php.c
--- bindings/php/php.c 13 May 2005 19:55:55 -0000 1.35
+++ bindings/php/php.c 13 May 2005 21:53:53 -0000
@@ -477,18 +477,19 @@
for(i=0;i<b->params;i++) {
struct rlib_value *v = rlib_value_stack_pop(vs);
+ int spot = b->params-i-1;
if(RLIB_VALUE_IS_STRING(v)) {
- params[i] = emalloc(sizeof(gpointer));
- MAKE_STD_ZVAL(*params[i]);
- (*params[i])->type = IS_STRING;
- (*params[i])->value.str.len = strlen(RLIB_VALUE_GET_AS_STRING(v));
- (*params[i])->value.str.val = estrdup(RLIB_VALUE_GET_AS_STRING(v));
+ params[spot] = emalloc(sizeof(gpointer));
+ MAKE_STD_ZVAL(*params[spot]);
+ (*params[spot])->type = IS_STRING;
+ (*params[spot])->value.str.len = strlen(RLIB_VALUE_GET_AS_STRING(v));
+ (*params[spot])->value.str.val = estrdup(RLIB_VALUE_GET_AS_STRING(v));
rlib_value_free(v);
} else if(RLIB_VALUE_IS_NUMBER(v)) {
- params[i] = emalloc(sizeof(gpointer));
- MAKE_STD_ZVAL(*params[i]);
- (*params[i])->type = IS_DOUBLE;
- (*params[i])->value.dval = (double)RLIB_VALUE_GET_AS_NUMBER(v) / (double)RLIB_DECIMAL_PRECISION;
+ params[spot] = emalloc(sizeof(gpointer));
+ MAKE_STD_ZVAL(*params[spot]);
+ (*params[spot])->type = IS_DOUBLE;
+ (*params[spot])->value.dval = (double)RLIB_VALUE_GET_AS_NUMBER(v) / (double)RLIB_DECIMAL_PRECISION;
rlib_value_free(v);
}
Index: libsrc/rlib.i
===================================================================
RCS file: /cvsroot/rlib/rlib/libsrc/rlib.i,v
retrieving revision 1.15
diff -u -r1.15 rlib.i
--- libsrc/rlib.i 2 May 2005 15:00:38 -0000 1.15
+++ libsrc/rlib.i 13 May 2005 21:53:53 -0000
@@ -27,7 +27,7 @@
int rlib_add_datasource_mysql(rlib *r, char *input_name, char *database_host, char *database_user, char *database_password, char *database_database);
int rlib_add_datasource_postgre(rlib *r, char *input_name, char *conn);
int rlib_add_datasource_odbc(rlib *r, char *input_name, char *source, char *user, char *password);
-gint rlib_add_datasource_xml(rlib *r, char *input_name);
+int rlib_add_datasource_xml(rlib *r, char *input_name);
int rlib_add_query_as(rlib *r, char *input_source, char *sql, char *name);
int rlib_add_report(rlib *r, char *name);
int rlib_add_report_from_buffer(rlib *r, char *buffer);