Re: [Rlib-devel] hello
Bob Doan <bdoan-J0aWFLYJOWhWk0Htik3J/[email protected]>
| Newsgroups | gmane.text.rlib.user |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 2005-04-10 at 17:18 +0200, Bruno Sadiez wrote: > hi Bob, > > > HOWEVER on 12/4/2004 someone sent in a patch that > > added support for > > Can this guy be contacted ? Warren Smith <warren-I/[email protected]> > > > > If you know c writing a custom input method is not > > hard at all. All you > > are doing is implementing some basic functions > > (fist, next, previous, > > last, ...) > You do not tell me much here. I need to bypass > rlib_add_datasource and rlib_add_query_as in order to > use RLIB this way. How can this be done ? RLIB works by having data sources (MYSQL, POSTGRESQL, ODBC, Custom) You Implement a "Class" that provides basic methods Then you call rlib_add_datasource(rlib_pointer_here, "Some Name", POINTER_TO_CLASS HERE); I attached the patch that Warren sent me. You can see how he implemented the XML Input class. > I am working on a philanthropy project (something like > > www.betterworldtelecom.com). I am not a professional > programmer and I started C writing 3-4 month ago. I'm > afraid my C is even worse than my english. Anyway if > the xml extentions I may add to rlib might be of > anyhelp I'd be glad to contribute. > > > If my software can be of any help to anybody why not ? > > > Regards > Bruno Maybe you can try to work w/ Warren to get the XML Input method included in the RLIB Source tree. - bob
rlib.patch
(text/x-patch, 44.2 KB)
diff -rdN rlib-1.2.1-ptel/configure.in rlib-1.2.1/configure.in
147,154d146
< AC_ARG_ENABLE(xml, [ --disable-xml disable xml backend],,enable_xml=yes)
< XML_CFLAGS=""
< XML_LIBS=""
< if test x$enable_xml = xyes; then
< AC_DEFINE(HAVE_XML,1,[Build with XML support])
< fi
< AM_CONDITIONAL(HAVE_XML, test x$enable_xml = xyes)
<
376,388d367
< AC_ARG_ENABLE(pslib, [ --disable-pslib disable cpdf output],,enable_pslib=yes)
< PSLIB_CFLAGS=""
< PSLIB_LIBS=""
< if test x$enable_pslib = xyes; then
< AC_CHECK_HEADER([libps/pslib.h],
< [AC_DEFINE([HAVE_PSLIB_H], [], [PSLIB Header])],
< [AC_MSG_ERROR([You must have pslib properly installed in order for rlib to work.. missing pslib.h])])
< AC_CHECK_LIB(ps, PS_boot, [], [AC_MSG_ERROR([You must have pslib properly installed in order for rlib to work.. missing libps.so])])
< CPDF_LIBS="-lps"
< AC_DEFINE(HAVE_PSLIB,1,[Build with PSLIB support])
< fi
< AM_CONDITIONAL(ENABLE_PSLIB, test x$enable_pslib = xyes)
<
390c369
< RLIB_LIBS="$LIBXML_LIBS $LIBGLIB_LIBS $LIBGMODULE_LIBS $MYSQL_LIBS $POSTGRE_LIBS $ODBC_LIBS $ICONVLIBS $CPDF_LIBS $PSLIB_LIBS"
---
> RLIB_LIBS="$LIBXML_LIBS $LIBGLIB_LIBS $LIBGMODULE_LIBS $MYSQL_LIBS $POSTGRE_LIBS $ODBC_LIBS $ICONVLIBS $CPDF_LIBS"
437d415
< inputs/xml/Makefile
456d433
< XML: ${enable_xml}
460d436
< PostScript: ${enable_pslib}
diff -rdN rlib-1.2.1-ptel/inputs/Makefile.am rlib-1.2.1/inputs/Makefile.am
35,38d34
< if HAVE_XML
< XML_INPUT=xml
< endif
<
42,43c38
< $(POSTGRE_INPUT) \
< $(XML_INPUT)
---
> $(POSTGRE_INPUT)
diff -rdN rlib-1.2.1-ptel/inputs/xml/Makefile.am rlib-1.2.1/inputs/xml/Makefile.am
1,30d0
< ## libsrc/Makefile.am for RLIB
<
< ## Copyright (c) 2004 Jeremy Lee (jlee-KfBRzk3UKwrYd54FQh9/[email protected])
< ## rlib 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.
<
< ## rlib 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.
<
< ## Report bugs to [email protected]
< ##
< ## Process this file with automake to produce Makefile.in
<
< lib_LTLIBRARIES = libr-xml.la
< libr_xml_la_SOURCES = xml.c
<
< libr_xml_la_LIBADD = $(RLIB_LIBS)
<
< INCLUDES = $(RLIB_CFLAGS) -I${top_srcdir}/libsrc/
< libr_xml_la_LDFLAGS = -release $(RLIB_VERSION)
< includedir=$(prefix)/include/rlib
diff -rdN rlib-1.2.1-ptel/inputs/xml/xml.c rlib-1.2.1/inputs/xml/xml.c
1,272d0
< #include <stdlib.h>
< #include <stdio.h>
< #include <string.h>
<
< #include <libxml/xmlversion.h>
< #include <libxml/xmlmemory.h>
<
< #include "glib.h"
< #include "rlib.h"
< #include "rlib_input.h"
<
< #define INPUT_PRIVATE(input) (((struct _private *)input->private))
<
< struct rlib_xml_results {
< xmlNodePtr data;
< xmlNodePtr first_row;
< xmlNodePtr last_row;
< xmlNodePtr this_row;
< xmlNodePtr first_field;
< gint isdone;
< };
<
< struct _private {
< xmlDocPtr doc;
< };
<
< gpointer rlib_xml_connect(gpointer input_ptr, gchar *input_file){
< struct input_filter *input = input_ptr;
< xmlDocPtr doc;
<
< doc = xmlReadFile(input_file, NULL, XML_PARSE_XINCLUDE);
< xmlXIncludeProcess(doc);
<
< if (doc == NULL) {
< rlogit("xmlParseError\n");
< return NULL;
< }
<
< INPUT_PRIVATE(input)->doc = doc;
< return doc;
< }
<
< static rlib_xml_input_close(gpointer input_ptr){
< struct input_filter *input = input_ptr;
< xmlFreeDoc(INPUT_PRIVATE(input)->doc);
< INPUT_PRIVATE(input)->doc = NULL;
<
< return 0;
< }
<
< static gint rlib_xml_first(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *result = result_ptr;
<
< result->this_row = result->first_row;
< if (result->this_row == NULL) {
< result->isdone = TRUE;
< return FALSE;
< }
<
< result->isdone = FALSE;
< return TRUE;
< }
<
< static gint rlib_xml_next(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *result = result_ptr;
< xmlNodePtr row;
<
< if (result->isdone)
< return FALSE;
<
< for (row = result->this_row->next; row != NULL && xmlStrcmp(row->name, (const xmlChar *) "row") != 0; row = row->next)
< ;
<
< if (row == NULL) {
< result->isdone = TRUE;
< return FALSE;
< }
<
< result->this_row = row;
< result->isdone = FALSE;
< return TRUE;
< }
<
< static gint rlib_xml_isdone(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *result = result_ptr;
< return result->isdone;
< }
<
< static gint rlib_xml_previous(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *result = result_ptr;
<
< if (result->this_row == NULL)
< return FALSE;
<
< if (result->this_row == result->first_row)
< return FALSE;
<
< result->isdone = FALSE;
<
< for (result->this_row = result->this_row->prev; xmlStrcmp(result->this_row->name, (const xmlChar *) "row") != 0; result->this_row = result->this_row->prev)
< ;
<
< return TRUE;
< }
<
< static gint rlib_xml_last(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *result = result_ptr;
<
< result->this_row = result->last_row;
< if (result->this_row == NULL)
< result->isdone = TRUE;
<
< return TRUE;
< }
<
< static gchar * rlib_xml_get_field_value_as_string(gpointer input_ptr, gpointer result_ptr, gpointer field_ptr){
< struct rlib_xml_results *result = result_ptr;
< gint field_index = (gint)field_ptr;
< xmlNodePtr col;
< xmlNodePtr field_value;
<
< if (result_ptr == NULL)
< return "";
<
< if (result->this_row == NULL)
< return "";
<
< field_value = NULL;
< for (col = result->this_row->xmlChildrenNode; col != NULL && field_index > 0; col = col->next) {
< if (xmlStrcmp(col->name, (const xmlChar *) "col") == 0) {
< if (field_index-- == 1) {
< field_index = 0;
< field_value = col;
< }
< }
< }
<
< if (field_value == NULL)
< return "";
<
< return field_value->xmlChildrenNode->content;
< }
<
< static gpointer rlib_xml_resolve_field_pointer(gpointer input_ptr, gpointer result_ptr, gchar *name){
< struct rlib_xml_results *results = result_ptr;
< xmlNodePtr field;
< gint field_index = 0;
<
< for (field = results->first_field; field != NULL; field = field->next) {
< if (xmlStrcmp(field->name, (const xmlChar *) "field") == 0) {
< ++field_index;
<
< if (xmlStrcmp(field->xmlChildrenNode->content, name) == 0)
< return (void *)field_index;
< }
< }
<
< return NULL;
< }
<
< void * xml_new_result_from_query(gpointer input_ptr, gchar *query){
< struct input_filter *input = input_ptr;
< struct rlib_xml_results *results;
< xmlNodePtr cur;
< xmlNodePtr data;
< xmlNodePtr rows;
< xmlNodePtr fields;
< xmlNodePtr first_row;
< xmlNodePtr last_row;
< xmlNodePtr first_field;
<
< cur = xmlDocGetRootElement(INPUT_PRIVATE(input)->doc);
< if (cur == NULL) {
< rlogit("xmlParseError \n");
< return NULL;
< }
< else if (xmlStrcmp(cur->name, (const xmlChar *) "data") != 0) {
< rlogit("document error: 'data' expected, '%s'found\n", cur->name);
< return NULL;
< }
<
< data = cur;
<
< for (cur = cur->xmlChildrenNode; cur; cur = cur->next) {
< if (xmlStrcmp(cur->name, (const xmlChar *) "rows") == 0)
< rows = cur;
< else if (xmlStrcmp(cur->name, (const xmlChar *) "fields") == 0)
< fields = cur;
< }
<
< if (rows == NULL) {
< rlogit("document error: 'rows' not found\n");
< return NULL;
< }
< else if (fields == NULL) {
< rlogit("document error: 'fields' not found\n");
< return NULL;
< }
<
< first_row = NULL;
< last_row = NULL;
< for (cur = rows->xmlChildrenNode; cur; cur = cur->next) {
< if (xmlStrcmp(cur->name, (const xmlChar *) "row") == 0) {
< if (first_row == NULL)
< first_row = cur;
< last_row = cur;
< }
< }
<
< if (first_row == NULL) {
< rlogit("'row' count is zero\n");
< return NULL;
< }
<
< first_field = NULL;
< for (cur = fields->xmlChildrenNode; cur && first_field == NULL; cur = cur->next) {
< if (xmlStrcmp(cur->name, (const xmlChar *) "field") == 0)
< first_field = cur;
< }
<
< if (first_field == NULL) {
< rlogit("'field' count is zero\n");
< return NULL;
< }
<
< results = g_malloc(sizeof(struct rlib_xml_results));
< if (results == NULL)
< return NULL;
<
< results->data = data;
< results->first_row = first_row;
< results->last_row = last_row;
< results->this_row = first_row;
< results->first_field = first_field;
< results->isdone = FALSE;
< return results;
< }
<
< static void rlib_xml_rlib_free_result(gpointer input_ptr, gpointer result_ptr){
< struct rlib_xml_results *results = result_ptr;
< g_free(results);
< }
<
< static gint rlib_xml_free_input_filter(gpointer input_ptr){
< struct input_filter *input = input_ptr;
< g_free(input->private);
< g_free(input);
< return 0;
< }
<
< gpointer rlib_xml_new_input_filter(){
< struct input_filter *input;
<
< input = g_malloc(sizeof(struct input_filter));
< input->private = g_malloc(sizeof(struct _private));
< memset(input->private, 0, sizeof(struct _private));
< input->input_close = rlib_xml_input_close;
< input->first = rlib_xml_first;
< input->next = rlib_xml_next;
< input->previous = rlib_xml_previous;
< input->last = rlib_xml_last;
< input->isdone = rlib_xml_isdone;
< input->new_result_from_query = xml_new_result_from_query;
< input->get_field_value_as_string = rlib_xml_get_field_value_as_string;
<
< input->resolve_field_pointer = rlib_xml_resolve_field_pointer;
<
< input->free = rlib_xml_free_input_filter;
< input->free_result = rlib_xml_rlib_free_result;
< return input;
< }
<
Binary files rlib-1.2.1-ptel/libsrc/.Makefile.am.swp and rlib-1.2.1/libsrc/.Makefile.am.swp differ
diff -rdN rlib-1.2.1-ptel/libsrc/Makefile.am rlib-1.2.1/libsrc/Makefile.am
27,30d26
< if ENABLE_PSLIB
< PSLIB_FILES=ps.c
< endif
<
33c29
< pcode.c pcode_op_functions.c formatstring.c fxp.c breaks.c $(CPDF_FILES) $(PSLIB_FILES)\
---
> pcode.c pcode_op_functions.c formatstring.c fxp.c breaks.c $(CPDF_FILES) \
diff -rdN rlib-1.2.1-ptel/libsrc/api.c rlib-1.2.1/libsrc/api.c
169,174d168
< #ifdef HAVE_PSLIB
< if(r->format == RLIB_CONTENT_TYPE_PS) {
< sprintf(buf, "Content-Type: application/postscript\nContent-Length: %ld%c", OUTPUT(r)->rlib_get_output_length(r), 10);
< return buf;
< }
< #endif
242,245d235
< #endif
< #ifdef HAVE_PSLIB
< if(!strcasecmp(name, "PS") || !strcasecmp(name, "POSTSCRIPT"))
< r->format = RLIB_FORMAT_PS;
diff -rdN rlib-1.2.1-ptel/libsrc/datasource.c rlib-1.2.1/libsrc/datasource.c
151,181d150
< #if HAVE_XML
< gint rlib_add_datasource_xml(rlib *r, gchar *input_name, gchar *source) {
< GModule* handle;
< gpointer rlib_xml_new_input_filter;
< gpointer rlib_xml_connect;
< gpointer (*f1)();
< gpointer (*f2)(gpointer, gchar *);
< gpointer xml;
<
< handle = g_module_open("libr-xml", 2);
< if (!handle) {
< rlogit("Could Not Load XML Input [%s]\n", g_module_error());
< return -1;
< }
< g_module_symbol(handle, "rlib_xml_new_input_filter", (gpointer *)&rlib_xml_new_input_filter);
< g_module_symbol(handle, "rlib_xml_connect", (gpointer *)&rlib_xml_connect);
< f1 = rlib_xml_new_input_filter;
< f2 = rlib_xml_connect;
< r->inputs[r->inputs_count].input = f1();
< xml = f2(r->inputs[r->inputs_count].input, source);
< r->inputs[r->inputs_count].name = g_strdup(input_name);
< if(xml == NULL) {
< rlogit("ERROR: Could not connect to XML data source\n");
< return -1;
< }
< r->inputs[r->inputs_count].handle = handle;
< r->inputs[r->inputs_count].input->info.encoder = NULL;
< r->inputs_count++;
< return 0;
< }
< #endif
diff -rdN rlib-1.2.1-ptel/libsrc/ps.c rlib-1.2.1/libsrc/ps.c
1,225d0
< #include <locale.h>
< #include <string.h>
<
< #include "config.h"
< #include "rlib.h"
<
< #include <libps/pslib.h>
<
< struct _private {
< PSDoc *psdoc;
< int font_id;
< float font_size;
< float fg_color[4];
< char *buffer;
< long buffer_length;
< int draw_hr;
< };
<
< static gfloat rlib_ps_get_string_width(rlib *r, gchar *text) {
< return PS_stringwidth(OUTPUT_PRIVATE(r)->psdoc, text, OUTPUT_PRIVATE(r)->font_id, OUTPUT_PRIVATE(r)->font_size);
< }
<
< static void rlib_ps_print_text(rlib *r, gfloat left_origin, gfloat bottom_origin, gchar *text, gint backwards, gint col) {
< PS_show_xy(OUTPUT_PRIVATE(r)->psdoc, text, left_origin * RLIB_PDF_DPI, bottom_origin * RLIB_PDF_DPI);
< }
<
< static void rlib_ps_set_fg_color(rlib *r, gfloat red, gfloat green, gfloat blue) {
< if (red != -1 && green != -1 && blue != -1) {
< PS_setcolor(OUTPUT_PRIVATE(r)->psdoc, "fillstroke", "rgb", red, green, blue, 0.0f);
< OUTPUT_PRIVATE(r)->fg_color[0] = red;
< OUTPUT_PRIVATE(r)->fg_color[1] = green;
< OUTPUT_PRIVATE(r)->fg_color[2] = blue;
< }
< }
<
< static void rlib_ps_drawbox(rlib *r, gfloat left_origin, gfloat bottom_origin, gfloat how_long, gfloat how_tall, struct rlib_rgb *color) {
< if (!(color->r == 1.0 || color->g == 1.0 || color->b == 1.0)) {
< left_origin *= RLIB_PDF_DPI;
< bottom_origin *= RLIB_PDF_DPI;
<
< if (OUTPUT_PRIVATE(r)->draw_hr == 1)
< how_long *= RLIB_PDF_DPI;
< else {
< how_tall -= .002;
< how_tall *= RLIB_PDF_DPI;
< }
<
< PS_setcolor(OUTPUT_PRIVATE(r)->psdoc, "fill", "rgb", color->r, color->g, color->b, 0.0f);
< PS_rect(OUTPUT_PRIVATE(r)->psdoc, left_origin, bottom_origin, how_long, how_tall);
< PS_fill(OUTPUT_PRIVATE(r)->psdoc);
< PS_setcolor(OUTPUT_PRIVATE(r)->psdoc, "fillstroke", "rgb", OUTPUT_PRIVATE(r)->fg_color[0], OUTPUT_PRIVATE(r)->fg_color[1], OUTPUT_PRIVATE(r)->fg_color[2], 0.0f);
< }
< }
<
< static void rlib_ps_hr(rlib *r, gint backwards, gfloat left_origin, gfloat bottom_origin, gfloat how_long, gfloat how_tall, struct rlib_rgb *color, gfloat indent, gfloat length) {
< OUTPUT_PRIVATE(r)->draw_hr = 1;
<
< PS_setcolor(OUTPUT_PRIVATE(r)->psdoc, "fill", "rgb", 0, 0, 0, 0);
< rlib_ps_drawbox(r, left_origin, bottom_origin, how_long, how_tall, color);
< PS_setcolor(OUTPUT_PRIVATE(r)->psdoc, "fillstroke", "rgb", OUTPUT_PRIVATE(r)->fg_color[0], OUTPUT_PRIVATE(r)->fg_color[1], OUTPUT_PRIVATE(r)->fg_color[2], 0);
<
< OUTPUT_PRIVATE(r)->draw_hr = 0;
< }
<
< static void rlib_ps_boxurl_start(rlib *r, gfloat left_origin, gfloat bottom_origin, gfloat how_long, gfloat how_tall, gchar *url) {
< if (r->landscape) {
< gfloat new_left = get_page_width(r) - left_origin - how_long;
< gfloat new_bottom = bottom_origin;
< PS_add_weblink(OUTPUT_PRIVATE(r)->psdoc, new_bottom, new_left, new_bottom + how_tall, new_left + how_long, url);
< } else {
< gfloat new_left = left_origin;
< gfloat new_bottom = bottom_origin;
< PS_add_weblink(OUTPUT_PRIVATE(r)->psdoc, new_left, new_bottom, new_left + how_long, new_bottom + how_tall, url);
< }
< }
<
< static void rlib_ps_drawimage(rlib *r, gfloat left_origin, gfloat bottom_origin, gchar *nname, gchar *type, gfloat nwidth, gfloat nheight) {
< int image_id = PS_open_image_file(OUTPUT_PRIVATE(r)->psdoc, type, nname, "", 0);
< int image_width;
< gfloat ratio;
<
< if (image_id > 0) {
< image_width = (int)PS_get_value(OUTPUT_PRIVATE(r)->psdoc, "imagewidth", (float)image_id);
< ratio = nwidth / image_width;
<
< PS_place_image(OUTPUT_PRIVATE(r)->psdoc, image_id, left_origin * RLIB_PDF_DPI, bottom_origin * RLIB_PDF_DPI, ratio);
< PS_close_image(OUTPUT_PRIVATE(r)->psdoc, image_id);
< }
< else
< rlogit("\nrlib_ps_drawimage: failed to open image file\n");
< }
<
< static void rlib_ps_set_font_point(rlib *r, gint point) {
< OUTPUT_PRIVATE(r)->font_size = point;
< PS_setfont(OUTPUT_PRIVATE(r)->psdoc, OUTPUT_PRIVATE(r)->font_id, OUTPUT_PRIVATE(r)->font_size);
< }
<
< static void rlib_ps_start_new_page(rlib *r) {
< struct rlib_report *report = r->reports[r->current_report];
< gint i=0;
< gint pages_across = report->pages_accross; // (sic)
< gint page_number = r->current_page_number * pages_across;
< gchar paper_type[40];
<
< PS_begin_page(OUTPUT_PRIVATE(r)->psdoc, report->paper->width, report->paper->height);
<
< for(i=0;i<pages_across;i++) {
< if(report->orientation == RLIB_ORIENTATION_LANDSCAPE) {
< report->position_bottom[i] = (report->paper->width / RLIB_PDF_DPI) - GET_MARGIN(r)->bottom_margin;
< PS_translate(OUTPUT_PRIVATE(r)->psdoc, 0.0, report->paper->height);
< PS_rotate(OUTPUT_PRIVATE(r)->psdoc, -90.0);
< r->landscape = 1;
< } else {
< report->position_bottom[i] = report->paper->height - GET_MARGIN(r)->bottom_margin;
< r->landscape = 0;
< }
< }
< }
<
< static void rlib_ps_set_working_page(rlib *r, gint page) {}
<
< static void rlib_ps_end_text(rlib *r) {}
< static void rlib_ps_init_end_page(rlib *r) {}
< static void rlib_ps_init_output(rlib *r) {}
<
< static void rlib_ps_begin_text(rlib *r) {}
<
< static void rlib_ps_finalize_private(rlib *r) {
< long buffer_length = 0;
< PS_close(OUTPUT_PRIVATE(r)->psdoc);
< OUTPUT_PRIVATE(r)->buffer = (gchar *)PS_get_buffer(OUTPUT_PRIVATE(r)->psdoc, &buffer_length);
< OUTPUT_PRIVATE(r)->buffer_length = buffer_length;
< }
<
< static void rlib_ps_spool_private(rlib *r) {
< ENVIRONMENT(r)->rlib_write_output(OUTPUT_PRIVATE(r)->buffer, OUTPUT_PRIVATE(r)->buffer_length);
< }
<
< static void rlib_ps_end_page(rlib *r) {
< PS_end_page(OUTPUT_PRIVATE(r)->psdoc);
< ++r->current_page_number;
< r->current_line_number = 1;
< rlib_init_page(r, FALSE);
< }
<
< static int rlib_ps_is_single_page(rlib *r) {
< return FALSE;
< }
<
< static int rlib_ps_free(rlib *r) {
< PS_delete(OUTPUT_PRIVATE(r)->psdoc);
< OUTPUT_PRIVATE(r)->psdoc = NULL;
< return 0;
< }
<
< static char * rlib_ps_get_output(rlib *r) {
< return OUTPUT_PRIVATE(r)->buffer;
< }
<
< static long rlib_ps_get_output_length(rlib *r) {
< return OUTPUT_PRIVATE(r)->buffer_length;
< }
<
< static void rlib_ps_stub_line(rlib *r, int backwards) {}
< static void rlib_ps_end_output_section(rlib *r) {}
< static void rlib_ps_start_output_section(rlib *r) {}
< static void rlib_ps_boxurl_end(rlib *r) {}
< static void rlib_ps_draw_cell_background_end(rlib *r) {}
< static void rlib_ps_start_report(rlib *r) {}
< static void rlib_ps_end_report(rlib *r) {}
<
<
< void rlib_ps_new_output_filter(rlib *r) {
< PSDoc *psdoc;
< OUTPUT(r) = g_malloc(sizeof(struct output_filter));
< OUTPUT_PRIVATE(r) = g_malloc(sizeof(struct _private));
< memset(OUTPUT_PRIVATE(r), 0, sizeof(struct _private));
<
< psdoc = PS_new();
< PS_open_file(psdoc, NULL);
< PS_set_info(psdoc, "Creator", "RLib");
< PS_set_info(psdoc, "Author", "RLib");
< // FIXME: Figoure out how to make this work.
< // PS_set_parameter(psdoc, "SearchPath", r->pdf_fontdir1);
<
< OUTPUT_PRIVATE(r)->psdoc = psdoc;
<
< // FIXME: This should not be hard-coded.
< OUTPUT_PRIVATE(r)->font_id = PS_findfont(psdoc, "/usr/share/texmf/fonts/afm/urw/courier/ucrr8a", NULL, 0);
<
< OUTPUT(r)->do_align = TRUE;
< OUTPUT(r)->do_break = TRUE;
< OUTPUT(r)->do_grouptext = TRUE;
<
< OUTPUT(r)->rlib_get_string_width = rlib_ps_get_string_width;
< OUTPUT(r)->rlib_print_text = rlib_ps_print_text;
< OUTPUT(r)->rlib_set_fg_color = rlib_ps_set_fg_color;
< OUTPUT(r)->rlib_set_bg_color = rlib_ps_set_fg_color;
< OUTPUT(r)->rlib_draw_cell_background_start = rlib_ps_drawbox;
< OUTPUT(r)->rlib_draw_cell_background_end = rlib_ps_draw_cell_background_end;
< OUTPUT(r)->rlib_hr = rlib_ps_hr;
< OUTPUT(r)->rlib_boxurl_start = rlib_ps_boxurl_start;
< OUTPUT(r)->rlib_boxurl_end = rlib_ps_boxurl_end;
< OUTPUT(r)->rlib_drawimage = rlib_ps_drawimage;
< OUTPUT(r)->rlib_set_font_point = rlib_ps_set_font_point;
< OUTPUT(r)->rlib_start_new_page = rlib_ps_start_new_page;
< OUTPUT(r)->rlib_end_page = rlib_ps_end_page;
< OUTPUT(r)->rlib_init_end_page = rlib_ps_init_end_page;
< OUTPUT(r)->rlib_end_text = rlib_ps_end_text;
< OUTPUT(r)->rlib_init_output = rlib_ps_init_output;
< OUTPUT(r)->rlib_start_report = rlib_ps_start_report;
< OUTPUT(r)->rlib_end_report = rlib_ps_end_report;
< OUTPUT(r)->rlib_begin_text = rlib_ps_begin_text;
< OUTPUT(r)->rlib_finalize_private = rlib_ps_finalize_private;
< OUTPUT(r)->rlib_spool_private = rlib_ps_spool_private;
< OUTPUT(r)->rlib_start_line = rlib_ps_stub_line;
< OUTPUT(r)->rlib_end_line = rlib_ps_stub_line;
< OUTPUT(r)->rlib_set_working_page = rlib_ps_set_working_page;
< OUTPUT(r)->rlib_is_single_page = rlib_ps_is_single_page;
< OUTPUT(r)->rlib_start_output_section = rlib_ps_start_output_section;
< OUTPUT(r)->rlib_end_output_section = rlib_ps_end_output_section;
< OUTPUT(r)->rlib_get_output = rlib_ps_get_output;
< OUTPUT(r)->rlib_get_output_length = rlib_ps_get_output_length;
< OUTPUT(r)->rlib_free = rlib_ps_free;
< }
diff -rdN rlib-1.2.1-ptel/libsrc/reportgen.c rlib-1.2.1/libsrc/reportgen.c
1191,1194d1190
< #ifdef HAVE_LIBPS
< else if(r->format == RLIB_FORMAT_PS)
< rlib_ps_new_output_filter(r);
< #endif
diff -rdN rlib-1.2.1-ptel/libsrc/rlib.h rlib-1.2.1/libsrc/rlib.h
41d40
< #define RLIB_WEB_CONTENT_TYPE_PS "Content-Type: application/postscript\n"
75d73
< #define RLIB_CONTENT_TYPE_PS 5
87d84
< #define RLIB_FORMAT_PS 6
639,641d635
< /***** PROTOTYPES: ps.c *******************************************************/
< void rlib_ps_new_output_filter(rlib *r);
<
654,657d647
<
< /***** PROTOTYPES: xml.c ******************************************************/
< gpointer rlib_xml_new_input_filter(void);
< gint rlib_add_datasource_xml( );
diff -rdN rlib-1.2.1-ptel/tests/Makefile.am rlib-1.2.1/tests/Makefile.am
31,38d30
< if HAVE_XML
< XML_INPUT=test4
< endif
<
< if ENABLE_PSLIB
< PSLIB_INPUT=test5
< endif
<
41,43c33
< $(POSTGRE_INPUT) \
< $(XML_INPUT) \
< $(PSLIB_INPUT)
---
> $(POSTGRE_INPUT)
55,60d44
<
< test4_SOURCES= test4.c
< test4_LDADD = -L${top_builddir}/libsrc/ $(RLIB_LIBS) -lr
<
< test5_SOURCES= test5.c
< test5_LDADD = -L${top_builddir}/libsrc/ $(RLIB_LIBS) -lr
diff -rdN rlib-1.2.1-ptel/tests/data.xml rlib-1.2.1/tests/data.xml
1,1169d0
< <?xml version="1.0"?>
< <data>
< <rows>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< <row>
< <col>John</col>
< <col>Doe</col>
< </row>
< </rows>
< <fields>
< <field>first_name</field>
< <field>last_name</field>
< </fields>
< </data>
diff -rdN rlib-1.2.1-ptel/tests/report.xml rlib-1.2.1/tests/report.xml
1,63d0
< <?xml version="1.0"?>
< <!DOCTYPE report >
< <Report fontSize="9" orientation="landscape">
< <ReportHeader>
< <Output>
< <Line/>
< <Line fontSize="12">
< <literal>IV Report</literal>
< </Line>
< <Line fontsize="4"/>
< <HorizontalLine size="4" bgcolor="'white'"/>
< <HorizontalLine size="2" bgcolor="'black'"/>
< <HorizontalLine size="4" bgcolor="'white'"/>
< </Output>
< </ReportHeader>
<
< <PageHeader>
< <Output>
< <Line fontSize="11">
< <literal>IV Report (Page Header)</literal>
< </Line>
< <HorizontalLine size="4" bgcolor="'white'"/>
< </Output>
< </PageHeader>
<
< <Detail>
< <FieldHeaders>
< <Output>
< <HorizontalLine size="1" bgcolor="'black'"/>
< <Line bgcolor="'0xe5e5e5'">
< <literal width="15" col="1">First Name</literal>
< <literal width="1"/>
< <literal width="20" col="2">Last Name</literal>
< <literal width="1"/>
< </Line>
< <HorizontalLine size="1" bgcolor="'black'"/>
< <HorizontalLine size="4" bgcolor="'white'"/>
< </Output>
< </FieldHeaders>
< <FieldDetails>
< <Output>
< <Line bgcolor="iif(r.detailcnt%2,'0xe5e5e5','white')">
< <field value="first_name" width="15" align="left" col="1"/>
< <literal width="1"/>
< <field value="last_name" width="20" align="left" col="2"/>
< <literal width="1"/>
< </Line>
< </Output>
< </FieldDetails>
< </Detail>
<
< <PageFooter>
< <Output>
< <Line>
< <literal>Page: </literal>
< <field value="r.pageno" width="3" align="right"/>
< </Line>
< </Output>
< </PageFooter>
<
< <ReportFooter>
< </ReportFooter>
< </Report>
diff -rdN rlib-1.2.1-ptel/tests/test4.c rlib-1.2.1/tests/test4.c
1,47d0
< /*
< * Copyright (C) 2003 SICOM Systems, INC.
< *
< * Authors: Bob Doan <bdoan-J0aWFLYJOWhWk0Htik3J/[email protected]>
< *
< * This program is free software; you can redistribute it and/or
< * modify it under the terms of version 2 of the GNU General Public
< * License as published by the Free Software Foundation.
< *
< * 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.
< */
<
< #include <rlib.h>
< #include <rlib_input.h>
<
< int main(int argc, char **argv) {
< char *xml_datasource;
< char *xml_report;
< rlib *r;
<
< if(argc != 3) {
< fprintf(stderr, "%s requires 2 arguments: xml data source and xml report\n", argv[0]);
< fprintf(stderr, "You provided %d\n", argc-1);
< return -1;
< }
<
< xml_datasource = argv[1];
< xml_report = argv[2];
<
< r = rlib_init();
< rlib_add_datasource_xml(r, "local_xml", xml_datasource);
< rlib_add_query_as(r, "local_xml", "", "data");
< rlib_add_report(r, xml_report, NULL);
< rlib_set_output_format(r, RLIB_FORMAT_PDF);
< rlib_execute(r);
< rlib_spool(r);
< rlib_free(r);
< return 0;
< }
diff -rdN rlib-1.2.1-ptel/tests/test5.c rlib-1.2.1/tests/test5.c
1,46d0
< /*
< * Authors: Jeremy Lee <jlee-KfBRzk3UKwrYd54FQh9/[email protected]> Warren Smith <wsmith-KfBRzk3UKwrYd54FQh9/[email protected]>
< *
< * This program is free software; you can redistribute it and/or
< * modify it under the terms of version 2 of the GNU General Public
< * License as published by the Free Software Foundation.
< *
< * 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.
< */
<
< #include <rlib.h>
< #include <rlib_input.h>
< #include <stdio.h>
<
< int main(int argc, char **argv) {
< char *xml_datasource;
< char *xml_report;
< rlib *r;
<
< if(argc != 3) {
< fprintf(stderr, "%s requires 2 arguments: xml data source and xml report\n", argv[0]);
< fprintf(stderr, "You provided %d\n", argc-1);
< return -1;
< }
<
< xml_datasource = argv[1];
< xml_report = argv[2];
<
< r = rlib_init();
< rlib_add_datasource_xml(r, "local_xml", xml_datasource);
< rlib_add_query_as(r, "local_xml", "", "data");
< rlib_add_report(r, xml_report, NULL);
< rlib_set_output_format(r, RLIB_FORMAT_PS);
< rlib_execute(r);
< rlib_spool(r);
< rlib_free(r);
< return 0;
< }