/* * $Id: xbase.cpp,v 1.8 2000/11/22 19:33:01 danny Exp $ * * This file is part of Oleo, the GNU spreadsheet. * * Copyright (C) 1998-1999 by the Free Software Foundation, Inc. * Written by Danny Backx . * * 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, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ extern "C" { static char rcsid[] = "$Id: xbase.cpp,v 1.8 2000/11/22 19:33:01 danny Exp $"; #include "config.h" #include #ifdef HAVE_LOCALE_H #include #endif #include #include "cmd.h" #include "basic.h" #include "io-utils.h" #include "io-term.h" } #if defined(HAVE_LIBXBASE) || defined(HAVE_LIBXDB) /* * Avoid Xbase madness */ #ifdef PACKAGE #undef PACKAGE #endif #ifdef VERSION #undef VERSION #endif #ifdef HAVE_LIBXBASE #include #endif #ifdef HAVE_LIBXDB #include #endif void CppReadXbaseFile(char *fn, int ismerge) { xbXBase x; xbDbf db(&x); int i, fc, rc, j; char *r; // fn = cell_value_string(curow, cucol, True); // fn = "/home/danny/LAND.DBF"; db.OpenDatabase(fn); fc = db.FieldCount(); /* Put DBF file headers on current row */ for (i=0; imodified = 1; recalculate(1); } extern "C" { /* * The C interface */ void ReadXbaseFile(char *name, int ismerge) { CppReadXbaseFile(name, ismerge); } char *oleoXdbVersion(void) { #ifdef XDB_VERSION return XDB_VERSION; #else #ifdef XBASE_VERSION return XBASE_VERSION; #else return "unknown"; #endif #endif } } #endif /* HAVE_LIBXBASE */