From edf366ae4ddbbe9079ed3be527fb07c80a803f36 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Wed, 30 Jan 2002 07:14:27 +0000 Subject: [PATCH] fixes for make dist git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6671 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/backend/file/test/Makefile.am | 1 + src/backend/file/test/test-dom-parser1.c | 2 +- src/backend/postgres/test/Makefile.am | 3 +- src/backend/rpc/Makefile.am | 1 + src/business/business-gnome/Makefile.am | 14 +- src/optional/Makefile.am | 3 + src/register/register-core/table-html.c | 253 ----------------------- src/register/register-core/table-html.h | 43 ---- 8 files changed, 18 insertions(+), 302 deletions(-) delete mode 100644 src/register/register-core/table-html.c delete mode 100644 src/register/register-core/table-html.h diff --git a/src/backend/file/test/Makefile.am b/src/backend/file/test/Makefile.am index a2e3e639e7..483ea27c87 100644 --- a/src/backend/file/test/Makefile.am +++ b/src/backend/file/test/Makefile.am @@ -65,5 +65,6 @@ AM_CFLAGS = \ EXTRA_DIST = \ grab-types.pl \ + test-dom-parser1.c \ test-load-module \ test-real-data.sh diff --git a/src/backend/file/test/test-dom-parser1.c b/src/backend/file/test/test-dom-parser1.c index 1ca91a8115..cc1b142a81 100644 --- a/src/backend/file/test/test-dom-parser1.c +++ b/src/backend/file/test/test-dom-parser1.c @@ -5,7 +5,7 @@ #include -#include "gnc-test-stuff.h" +#include "test-stuff.h" #include "gnc-xml-helper.h" #include "sixtp.h" diff --git a/src/backend/postgres/test/Makefile.am b/src/backend/postgres/test/Makefile.am index 82ea5fc3fd..8cc127e05c 100644 --- a/src/backend/postgres/test/Makefile.am +++ b/src/backend/postgres/test/Makefile.am @@ -16,7 +16,8 @@ TESTS_ENVIRONMENT := \ noinst_PROGRAMS = \ test-db \ - test-escape + test-escape \ + test-period LDADD = ${top_srcdir}/src/test-core/libgncmod-test.la \ ${top_srcdir}/src/gnc-module/libgncmodule.la \ diff --git a/src/backend/rpc/Makefile.am b/src/backend/rpc/Makefile.am index 1752ac1880..a1ce07f1b9 100644 --- a/src/backend/rpc/Makefile.am +++ b/src/backend/rpc/Makefile.am @@ -40,6 +40,7 @@ RPCGEN_FILES = \ EXTRA_DIST = \ .cvsignore \ README \ + gncRpc_server_stubs.c \ $(RPCGEN_SRCS) LDADD = -lpthread diff --git a/src/business/business-gnome/Makefile.am b/src/business/business-gnome/Makefile.am index ae886752c7..b998ecaa39 100644 --- a/src/business/business-gnome/Makefile.am +++ b/src/business/business-gnome/Makefile.am @@ -32,7 +32,8 @@ libgncmod_business_gnome_la_SOURCES = \ dialog-job.c \ dialog-job-select.c \ dialog-order.c \ - dialog-vendor.c + dialog-vendor.c \ + gnc-business-utils.c noinst_HEADERS = \ business-chooser.h \ @@ -44,7 +45,8 @@ noinst_HEADERS = \ dialog-job.h \ dialog-job-select.h \ dialog-order.h \ - dialog-vendor.h + dialog-vendor.h \ + gnc-business-utils.h libgncmod_business_gnome_la_LDFLAGS = -module @@ -79,13 +81,17 @@ glade_DATA = \ order.glade \ vendor.glade -EXTRA_DIST = $(glade_DATA) - gwmoddir = ${GNC_GWRAP_LIBDIR} gwmod_DATA = \ gw-business-gnome.scm \ gw-business-gnome-spec.scm +EXTRA_DIST = \ + .cvsignore \ + ${glade_DATA} \ + ${gncmod_DATA} \ + ${gwmod_DATA} + .scm-links: rm -f gnucash g-wrapped ln -sf . gnucash diff --git a/src/optional/Makefile.am b/src/optional/Makefile.am index 97fc3153c8..44f2bbad72 100644 --- a/src/optional/Makefile.am +++ b/src/optional/Makefile.am @@ -5,5 +5,8 @@ EXTRA_DIST = \ # N.B. Do *not* specify subdirs, since we do *not* want the swig subdirs # built by default, since many folks may not have swig installed, and this # is, after all, optional. But do put them in the dist. +# For some reason, we need to set SUBDIRS to a blank to +# get this to work (automake 1.4p5). +SUBDIRS = DIST_SUBDIRS = swig diff --git a/src/register/register-core/table-html.c b/src/register/register-core/table-html.c deleted file mode 100644 index e9ae7105a4..0000000000 --- a/src/register/register-core/table-html.c +++ /dev/null @@ -1,253 +0,0 @@ -/********************************************************************\ - * table-html.c -- print table as html * - * * - * 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 of * - * the License, 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * table-html.c - * - * FUNCTION: - * Implements the infrastructure for the displayed table. - * This is just a sample hack for printing html to a file, - * or by acting as a web server. Its cheesey, for several - * reasons: - * - * (1) HTML should never be put in the same file as C code. - * Some sort of template file should be used. - * - * (2) The data printed hre is obtained from the displayed - * ledger/register. Thus, it accurately reflects - * what's in the ledger, but is otherwise a cheesy way - * of doing a report. Real report generators should - * get the financial data straight from the engine, - * not from the register. - * - * (3) The so-called "webserver" has less intelligence - * than a mosquito. - * - * But this code is fun, so what the hey. - * - * - * HISTORY: - * Copyright (c) 1998 Linas Vepstas - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include "cellblock.h" -#include "table-allgui.h" -#include "table-html.h" -#include "util.h" - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_REGISTER; - -/* ==================================================== */ - -CellBlock * -getcurs (Table *table, int prow) -{ - int vrow; - vrow = table->locators[prow][0]->virt_row; - return (table->handlers[vrow][0]); -} - -int -xaccTableDumpHTML (Table * table, int fd) -{ - FILE * fh; - int i, j; - CellBlock *curs, *head, *trans; - int cnt = 0; - - if ((!table) || (0 > fd)) return 0; - - /* fd could be a file descriptor for a file, or for a socket. */ - fh = fdopen (fd, "a"); - if (!fh) { - int norr = errno; - PERR ("can't open fd=%d \n" - "\t(%d) %s \n", fd, norr, strerror (norr)); - return 0; - } - - /* print the header */ - cnt += fprintf (fh, - "\n" - "GnuCash Regsiter\n" - "\n" - "

GnuCash Register

\n" - "\n"); - - /* print the table header rows */ - head = getcurs (table, 0); - i = 0; - do { - cnt += fprintf (fh, "\n"); - for (j=0; jnum_phys_cols; j++) { - cnt += fprintf (fh, "", table->entries[i][j]); - } - cnt += fprintf (fh, "\n"); - - i++; - curs = getcurs (table, i); - } while (head == curs); - trans = curs; - - /* print the body of the table */ - for (; inum_phys_rows; i++) { - curs = getcurs (table, i); - - if (trans == curs) { - cnt += fprintf (fh, "\n"); - } else { - cnt += fprintf (fh, "\n"); - } - - for (j=0; jnum_phys_cols; j++) { - if (0x0 == table->entries[i][j][0]) { - cnt += fprintf (fh, ""); - } else { - cnt += fprintf (fh, "", table->entries[i][j]); - } - } - cnt += fprintf (fh, "\n"); - } - - cnt += fprintf (fh, "
%s
 %s
"); - fflush (fh); - - return cnt; -} - -/* ==================================================== */ - -int -xaccTablePrintHTML (Table * table, char *filename) -{ - int fd; - int cnt; - - if ((!table) || (!filename)) return 0; - - fd = open (filename, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); - if (0 > fd) { - int norr = errno; - PERR ("can't open file %s\n" - "\t(%d) %s\n", filename, norr, strerror (norr)); - return 0; - } - cnt = xaccTableDumpHTML (table, fd); - close (fd); - return (cnt); -} - -/* ==================================================== */ -/* implement a cheesy web server */ -/* maybe not the worlds smallest web server, but close */ - -#define CHKERR(val, msg) { \ - if (0 > val) { \ - int norr = errno; \ - PERR ( msg "\n" \ - "(%d) %s \n", norr, strerror (norr)); \ - if (pid) return; \ - exit (0); \ - } \ -} - -void -xaccTableWebServeHTML (Table * table, unsigned short port) -{ - int listen_fd, accept_fd; - pid_t pid; - int rc; - struct sockaddr_in myaddr; - struct sockaddr clientsock; - int clientaddrsize = sizeof (struct sockaddr); - fd_set readfds; - struct timeval timeout; - char buff[255]; - int cnt; - - if (!table) return; - - /* don't slow down the parent, fork into background */ - pid = fork(); - if (0 < pid) return; /* parent */ - CHKERR (pid, "cant fork"); - - /* create a socket */ - listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - CHKERR (listen_fd, "cant listen"); - - memset ((void*) &myaddr, 0, sizeof (struct sockaddr_in)); - myaddr.sin_family = AF_INET; - myaddr.sin_addr.s_addr = htonl (INADDR_ANY); - myaddr.sin_port = htons (port); /* WWW server is port 80 but that is usperuser only */ - rc = bind (listen_fd, (struct sockaddr *) &myaddr, sizeof (struct sockaddr)); - CHKERR (rc, "cant bind"); - - rc = listen (listen_fd, 10); - CHKERR (rc, "cant listen"); - - /* if no one connects to us after 8 minutes, just exit */ - FD_ZERO (&readfds); - FD_SET (listen_fd, &readfds); - timeout.tv_sec = 500; - timeout.tv_usec = 0; - rc = select (160, &readfds, NULL, NULL, &timeout); - CHKERR (rc, "cant select"); - if (0 == rc) exit (0); - - accept_fd = accept (listen_fd, &clientsock, &clientaddrsize); - CHKERR (rc, "cant accept"); - - /* count the number of chars, for content-length */ - cnt = xaccTablePrintHTML (table, "/dev/null"); - snprintf (buff, 255, - "HTTP/1.0 200 OK\n" - "Connection: close\n" - "Content-Length: %d\n" - "Content-Type: text/html\n\n", cnt); - write (accept_fd, buff, sizeof (buff)); - xaccTableDumpHTML (table, accept_fd); - - /* linger for some @#$%^ reason, otherwise browser complains */ - sleep (30); - shutdown (accept_fd, 1); - close (accept_fd); - close (listen_fd); - exit (0); -} - -/* ================== end of file ======================= */ diff --git a/src/register/register-core/table-html.h b/src/register/register-core/table-html.h deleted file mode 100644 index f1f6b70894..0000000000 --- a/src/register/register-core/table-html.h +++ /dev/null @@ -1,43 +0,0 @@ -/********************************************************************\ - * table-html.h -- print table as html * - * * - * 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 of * - * the License, 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * table-html.h - * - * FUNCTION: - * This header defines the HTML specific functions - * associated with the Table GUI. This is just sample code. - * - * HISTORY: - * Copyright (c) 1998 Linas Vepstas - */ - -#ifndef XACC_TABLE_HTML_H -#define XACC_TABLE_HTML_H - -int xaccTableDumpHTML (Table * table, int fd); -int xaccTablePrintHTML (Table * table, char *filename); -void xaccTableWebServeHTML (Table * table, unsigned short port); - - -#endif XACC_TABLE_HTML_H