#!/bin/sh # This is a shell archive (produced by GNU sharutils 4.2.1). # To extract the files from this archive, save it to some FILE, remove # everything before the `!/bin/sh' line above, then type `sh FILE'. # # Made on 2005-02-23 14:16 CET by . # Source directory was `/tmp'. # # Existing files will *not* be overwritten unless `-c' is specified. # This format requires very little intelligence at unshar time. # "if test", "echo", "mkdir", and "sed" may be needed. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 898 -rw-r--r-- sqlite-g0.2/README # 4581 -rw-r--r-- sqlite-g0.2/sqlite-g.scm # 3604 -rw-r--r-- sqlite-g0.2/sqlite-cdecl.scm # 7071 -rw-r--r-- sqlite-g0.2/sqlite-cdef.scm # 2755 -rwxr-xr-x sqlite-g0.2/sqlite-g-example # 18009 -rw-r--r-- sqlite-g0.2/COPYING # echo=echo if mkdir _sh03815; then $echo 'x -' 'creating lock directory' else $echo 'failed to create lock directory' exit 1 fi # ============= sqlite-g0.2/README ============== if test ! -d 'sqlite-g0.2'; then $echo 'x -' 'creating directory' 'sqlite-g0.2' mkdir 'sqlite-g0.2' fi if test -f 'sqlite-g0.2/README' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/README' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/README' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/README' && XREADME file for Sqlite-G version 0.1 X==================================== X X This software is Copyright (c) 2005 by Thomas Hafner, all rights X reserved. X X This is free software, see the file COPYING for details. X X The software shall help using SQLite when programming in Gambit-C. X The author used the following environment. X - sqlite 2.8.15 X - Gambit-C 4.0 beta 11 X - Debian 3.0 with kernel Linux 2.4.26 X X XUSAGE X X - Compile the library: X gsc -dynamic -ld-options "-lsqlite -static -o sqlite-g.o1" sqlite-g.scm X X - Let gsi load the library: X (load "sqlite-g") X X - Use the interface provided by the library (see comment in file X sqlite-g.scm). X XEXAMPLE X X See the file sqlite-g-example. You may chmod +x it (not X automatically done during unpacking from "vanilla" shar file) and X run it: X ./sqlite-g-example DATABASE X (DATABASE is the path of a SQLite database file to be created.) SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/README' 'failed' fi # ============= sqlite-g0.2/sqlite-g.scm ============== if test -f 'sqlite-g0.2/sqlite-g.scm' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/sqlite-g.scm' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/sqlite-g.scm' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/sqlite-g.scm' && X;; Copyright (c) 2005 Thomas Hafner X;; X;; This file is part of Sqlite-G. X;; X;; Sqlite-G is free software; you can redistribute it and/or modify it X;; under the terms of the GNU General Public License as published by X;; the Free Software Foundation; either version 2 of the License, or X;; (at your option) any later version. X;; X;; Sqlite-G is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; You should have received a copy of the GNU General Public License X;; along with Sqlite-G; if not, write to the Free Software Foundation, X;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA X X;; This program is free software; you can redistribute it and/or X;; modify it under the terms of the GNU General Public License as X;; published by the Free Software Foundation; either version 2 of the X;; License, or (at your option) any later version. X;; X;; This program is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; History: X;; X;; 2005-01-16 Thomas Hafner: First trial. Provide sqlite-open, X;; sqlite-exec and sqlite-close. X;; X;; 2005-02-20 Thomas Hafner: Gotten rid of c-define forms to become X;; thread save. X X;; interface: ( X(define sqlite-open #f) X(define sqlite-compile #f) X(define sqlite-step #f) X(define sqlite-finalize #f) X(define sqlite-close #f) X;; ) X X(include "sqlite-cdecl.scm") X X(let () X (include "sqlite-cdef.scm") X X (set! sqlite-open X (lambda (filename mode) X (let* ((sr (sqlite-open-do filename mode)) X (db (sqlite-open-get-retval sr)) X (errmsg (and db (sqlite-open-get-errmsg sr)))) X (sqlite-open-free sr) X (values db errmsg)))) X X (set! sqlite-compile X (lambda (db sql) X (let* ((sr (sqlite-compile-do db sql)) X (status-string (sqlite-compile-get-status sr)) X (status (string->symbol status-string)) X (ok (eq? 'ok status)) X (tail (sqlite-compile-get-tail sr)) X (vm (and ok (sqlite-compile-get-vm sr))) X (errmsg (sqlite-compile-get-errmsg sr))) X (sqlite-compile-free sr) X (values status tail vm errmsg)))) X X (set! sqlite-step X (lambda (vm) X (define list-strings X (lambda (sr number getstring) X (let next ((limit number) (acc '())) X (if (>= 0 limit) X acc X (let* ((index (- limit 1)) X (s (getstring sr index))) X (next index (cons s acc))))))) X X (define get-values X (lambda (sr status nof-cols) X (case status X ((row) (list-strings sr nof-cols sqlite-step-get-value)) X (else '())))) X X (define get-colnames X (lambda (sr status nof-cols) X (case status X ((row done) X (list-strings sr nof-cols sqlite-step-get-colname)) X (else '())))) X X (define get-types X (lambda (sr status nof-cols) X (case status X ((row done todo) X (list-strings sr nof-cols sqlite-step-get-type)) X (else '())))) X X (let* ((sr (sqlite-step-do vm)) X (status-string (sqlite-step-get-status sr)) X (status (string->symbol status-string)) X (nof-cols (sqlite-step-get-n sr)) X (types (get-types sr status nof-cols)) X (colnames (get-colnames sr status nof-cols)) X (vals (get-values sr status nof-cols))) X (sqlite-step-free sr) X (values status nof-cols vals colnames types)))) X X (set! sqlite-finalize X (lambda (vm) X (let* ((sr (sqlite-finalize-do vm)) X (status-string (sqlite-finalize-get-status sr)) X (status (string->symbol status-string)) X (errmsg (sqlite-finalize-get-errmsg sr))) X (sqlite-finalize-free sr) X (values status errmsg)))) X X (set! sqlite-close sqlite-close-do)) SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/sqlite-g.scm' 'failed' fi # ============= sqlite-g0.2/sqlite-cdecl.scm ============== if test -f 'sqlite-g0.2/sqlite-cdecl.scm' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/sqlite-cdecl.scm' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/sqlite-cdecl.scm' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/sqlite-cdecl.scm' && X;; Copyright (c) 2005 Thomas Hafner X;; X;; This file is part of Sqlite-G. X;; X;; Sqlite-G is free software; you can redistribute it and/or modify it X;; under the terms of the GNU General Public License as published by X;; the Free Software Foundation; either version 2 of the License, or X;; (at your option) any later version. X;; X;; Sqlite-G is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; You should have received a copy of the GNU General Public License X;; along with Sqlite-G; if not, write to the Free Software Foundation, X;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA X X;; This program is free software; you can redistribute it and/or X;; modify it under the terms of the GNU General Public License as X;; published by the Free Software Foundation; either version 2 of the X;; License, or (at your option) any later version. X;; X;; This program is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; History: X;; X;; 2005-02-20 Thomas Hafner: Created file to group C declarations for X;; sqlite-g.scm.q X X(c-declare X" X#include X#include X#include \"sqlite.h\" X Xtypedef struct SqliteG_OpenResult_s { X sqlite *retval; X sqlite *db; X char *zErrMsg; X} SqliteG_OpenResult_t; X Xtypedef struct SqliteG_CompileResult_s { X int retval; X char *zStatus; X sqlite_vm *pVm; X char *zErrMsg; X char zTail[1]; /* more characters may follow */ X} SqliteG_CompileResult_t; X Xtypedef struct SqliteG_StepResult_s { X int retval; X char *zStatus; X int N; X char const **azValue; X char const **azColName; X} SqliteG_StepResult_t; X Xtypedef struct SqliteG_FinalizeResult_s { X int retval; X char *zStatus; X char *zErrMsg; X} SqliteG_FinalizeResult_t; X Xstatic char *SqliteG_StatusToString( X int status) X{ X switch (status) { X case SQLITE_OK: return \"ok\"; X case SQLITE_ERROR: return \"error\"; X case SQLITE_INTERNAL: return \"internal\"; X case SQLITE_PERM: return \"perm\"; X case SQLITE_ABORT: return \"abort\"; X case SQLITE_BUSY: return \"busy\"; X case SQLITE_LOCKED: return \"locked\"; X case SQLITE_NOMEM: return \"nomem\"; X case SQLITE_READONLY: return \"readonly\"; X case SQLITE_INTERRUPT: return \"interrupt\"; X case SQLITE_IOERR: return \"ioerr\"; X case SQLITE_CORRUPT: return \"corrupt\"; X case SQLITE_NOTFOUND: return \"notfound\"; X case SQLITE_FULL: return \"full\"; X case SQLITE_CANTOPEN: return \"cantopen\"; X case SQLITE_PROTOCOL: return \"protocol\"; X case SQLITE_EMPTY: return \"empty\"; X case SQLITE_SCHEMA: return \"schema\"; X case SQLITE_TOOBIG: return \"toobig\"; X case SQLITE_CONSTRAINT: return \"constraint\"; X case SQLITE_MISMATCH: return \"mismatch\"; X case SQLITE_MISUSE: return \"misuse\"; X case SQLITE_NOLFS: return \"nolfs\"; X case SQLITE_AUTH: return \"auth\"; X case SQLITE_FORMAT: return \"format\"; X case SQLITE_RANGE: return \"range\"; X case SQLITE_NOTADB: return \"notadb\"; X case SQLITE_ROW: return \"row\"; X case SQLITE_DONE: return \"done\"; X default: return \"?\"; X } X}") SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/sqlite-cdecl.scm' 'failed' fi # ============= sqlite-g0.2/sqlite-cdef.scm ============== if test -f 'sqlite-g0.2/sqlite-cdef.scm' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/sqlite-cdef.scm' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/sqlite-cdef.scm' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/sqlite-cdef.scm' && X;; Copyright (c) 2005 Thomas Hafner X;; X;; This file is part of Sqlite-G. X;; X;; Sqlite-G is free software; you can redistribute it and/or modify it X;; under the terms of the GNU General Public License as published by X;; the Free Software Foundation; either version 2 of the License, or X;; (at your option) any later version. X;; X;; Sqlite-G is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; You should have received a copy of the GNU General Public License X;; along with Sqlite-G; if not, write to the Free Software Foundation, X;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA X X;; This program is free software; you can redistribute it and/or X;; modify it under the terms of the GNU General Public License as X;; published by the Free Software Foundation; either version 2 of the X;; License, or (at your option) any later version. X;; X;; This program is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; History: X;; X;; 2005-02-20 Thomas Hafner: Created file to group C definitions for X;; sqlite-g.scm. X X(define sqlite-open-do X (c-lambda X (nonnull-char-string int) ;(filename mode) X (pointer "SqliteG_OpenResult_t") X " X SqliteG_OpenResult_t *pResult = NULL; X if (___arg1) { X pResult = calloc(1, sizeof *pResult); X if (pResult) { X pResult->retval = sqlite_open( X ___arg1, X ___arg2, X &pResult->zErrMsg); X } X } X ___result = pResult;")) X X(define sqlite-open-get-retval X (c-lambda X ((pointer "SqliteG_OpenResult_t")) X (pointer "sqlite") X " X ___result = (___arg1 ? ___arg1->retval : NULL);")) X X(define sqlite-open-get-errmsg X (c-lambda X ((pointer "SqliteG_OpenResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zErrMsg : NULL);")) X X(define sqlite-open-free X (c-lambda X ((pointer "SqliteG_OpenResult_t")) X void X " X if (___arg1) { X if (___arg1->zErrMsg) { X sqlite_freemem(___arg1->zErrMsg); X } X free(___arg1); X }")) X X(define sqlite-compile-do X (c-lambda X ((pointer "sqlite") nonnull-char-string) ;(db sql) X (pointer "SqliteG_CompileResult_t") X " X SqliteG_CompileResult_t result; X char const *zTail; X size_t sizeTail; X SqliteG_CompileResult_t *pResult = NULL; X if (___arg1 && ___arg2) { X result.retval = sqlite_compile( X ___arg1, X ___arg2, X &zTail, X &result.pVm, X &result.zErrMsg); X result.zStatus = SqliteG_StatusToString(result.retval); X sizeTail = strlen(zTail) + 1; X pResult = calloc(1, sizeof *pResult - sizeof pResult->zTail + sizeTail); X if (pResult) { X *pResult = result; X memcpy(pResult->zTail, zTail, sizeTail); X } X } X ___result = pResult;")) X X(define sqlite-compile-get-status X (c-lambda X ((pointer "SqliteG_CompileResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zStatus : NULL);")) X X(define sqlite-compile-get-tail X (c-lambda X ((pointer "SqliteG_CompileResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zTail : NULL);")) X X(define sqlite-compile-get-vm X (c-lambda X ((pointer "SqliteG_CompileResult_t")) X (pointer "sqlite_vm") X " X ___result = (___arg1 ? ___arg1->pVm : NULL);")) X X(define sqlite-compile-get-errmsg X (c-lambda X ((pointer "SqliteG_CompileResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zErrMsg : NULL);")) X X(define sqlite-compile-free X (c-lambda X ((pointer "SqliteG_CompileResult_t")) X void X " X if (___arg1) { X if (___arg1->zErrMsg) { X sqlite_freemem(___arg1->zErrMsg); X } X free(___arg1); X }")) X X(define sqlite-step-do X (c-lambda X ((pointer "sqlite_vm")) X (pointer "SqliteG_StepResult_t") X " X SqliteG_StepResult_t *pResult = NULL; X if (___arg1) { X pResult = calloc(1, sizeof *pResult); X if (pResult) { X pResult->retval = sqlite_step( X ___arg1, X &pResult->N, X &pResult->azValue, X &pResult->azColName); X pResult->zStatus = SqliteG_StatusToString( X pResult->retval); X } X } X ___result = pResult;")) X X(define sqlite-step-get-status X (c-lambda X ((pointer "SqliteG_StepResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zStatus : NULL);")) X X(define sqlite-step-get-n X (c-lambda X ((pointer "SqliteG_StepResult_t")) X int X " X ___result = (___arg1 ? ___arg1->N : 0);")) X X(define sqlite-step-get-value X (c-lambda X ((pointer "SqliteG_StepResult_t") int) X char-string X " X ___result = (char *)( X (___arg1 && ___arg1->azValue) ? X ___arg1->azValue[___arg2] : X NULL);")) X X(define sqlite-step-get-colname X (c-lambda X ((pointer "SqliteG_StepResult_t") int) X char-string X " X ___result = (char *)( X (___arg1 && ___arg1->azColName) ? X ___arg1->azColName[___arg2] : X NULL);")) X X(define sqlite-step-get-type X (c-lambda X ((pointer "SqliteG_StepResult_t") int) X char-string X " X ___result = (char *)( X (___arg1 && ___arg1->azColName) ? X ___arg1->azColName[___arg1->N + ___arg2] : X NULL);")) X X(define sqlite-step-free X (c-lambda X ((pointer "SqliteG_StepResult_t")) X void X " X if (___arg1) { X free(___arg1); X }")) X X X(define sqlite-finalize-do X (c-lambda X ((pointer "sqlite_vm")) X (pointer "SqliteG_FinalizeResult_t") X " X SqliteG_FinalizeResult_t *pResult = NULL; X if (___arg1) { X pResult = calloc(1, sizeof *pResult); X if (pResult) { X pResult->retval = sqlite_finalize( X ___arg1, X &pResult->zErrMsg); X pResult->zStatus = SqliteG_StatusToString( X pResult->retval); X } X } X ___result = pResult;")) X X(define sqlite-finalize-get-status X (c-lambda X ((pointer "SqliteG_FinalizeResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zStatus : NULL);")) X X(define sqlite-finalize-get-errmsg X (c-lambda X ((pointer "SqliteG_FinalizeResult_t")) X char-string X " X ___result = (___arg1 ? ___arg1->zErrMsg : NULL);")) X X(define sqlite-finalize-free X (c-lambda X ((pointer "SqliteG_FinalizeResult_t")) X void X " X if (___arg1) { X if (___arg1->zErrMsg) { X sqlite_freemem(___arg1->zErrMsg); X } X free(___arg1); X }")) X X(define sqlite-close-do X (c-lambda X ((pointer "sqlite")) X void X " X if (___arg1) { X sqlite_close(___arg1); X }")) SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/sqlite-cdef.scm' 'failed' fi # ============= sqlite-g0.2/sqlite-g-example ============== if test -f 'sqlite-g0.2/sqlite-g-example' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/sqlite-g-example' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/sqlite-g-example' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/sqlite-g-example' && X#!/usr/bin/env gsi-script X;; -*- mode: Scheme -*- X X;; Copyright (c) 2005 Thomas Hafner X;; X;; This program is free software; you can redistribute it and/or X;; modify it under the terms of the GNU General Public License as X;; published by the Free Software Foundation; either version 2 of the X;; License, or (at your option) any later version. X;; X;; This program is distributed in the hope that it will be useful, but X;; WITHOUT ANY WARRANTY; without even the implied warranty of X;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X;; General Public License for more details. X;; X;; History: X;; X;; v0.1 2005-01-16 Thomas Hafner: Used for sqlite-g.scm v0.1. X;; X;; v0.2 2005-02-20 Thomas Hafner: Used for sqlite-g.scm v0.2. X;; X;;-- X;; X;; Usage: X;; sqlite-g-demo dbfile.sql X X(load "sqlite-g") X X(define sqlite-demo X (lambda (db-path) X (define step-through X (lambda (vm) X (call-with-values X (lambda () (sqlite-step vm)) X (lambda (status nof-cols vals colnames types) X (pretty-print `(sqlite-step:OUT: ,status ,nof-cols ,vals ,colnames ,types)) X (if (eq? 'row status) X (step-through vm)))))) X X ;; compile, step, ..., finalize for *one* SQL command: X (define sqlite-exec X (lambda (db sql) X (pretty-print `(sqlite-exec:IN: ,sql)) X (call-with-values X (lambda () (sqlite-compile db sql)) X (lambda (status tail vm comperr) X (pretty-print `(sqlite-compile:OUT: ,status ,tail ,vm ,comperr)) X (if vm X ;; compile did succeed: X (begin X (step-through vm) X (call-with-values X (lambda () (sqlite-finalize vm)) X (lambda (status finalerr) X (pretty-print `(finalize:OUT: ,status ,finalerr)))) X tail) X ;; compile did not succeed: X #f))))) X X (let ((sql-commands X " XCREATE TABLE demotable (no INTEGER PRIMARY KEY, name); XINSERT INTO demotable VALUES (1, \"Adam\"); XINSERT INTO demotable VALUES (2, \"Eva\"); XSELECT * FROM demotable;") X (db-file-mode #o644)) X (call-with-values X (lambda () (sqlite-open db-path db-file-mode)) X (lambda (db errmsg) X (if db X ;; DB opened: X (begin X (let next ((sql sql-commands)) X (if sql X (let ((tail (sqlite-exec db sql))) X (next tail)))) X (pretty-print `(sqlite-close:IN: ,db)) X (sqlite-close db)) X ;; DB not opened: X (abort errmsg))))))) X X(define main X (lambda (db-path . ignore) X (sqlite-demo db-path))) SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/sqlite-g-example' 'failed' fi # ============= sqlite-g0.2/COPYING ============== if test -f 'sqlite-g0.2/COPYING' && test "$first_param" != -c; then $echo 'x -' SKIPPING 'sqlite-g0.2/COPYING' '(file already exists)' else $echo 'x -' extracting 'sqlite-g0.2/COPYING' '(text)' sed 's/^X//' << 'SHAR_EOF' > 'sqlite-g0.2/COPYING' && X GNU GENERAL PUBLIC LICENSE X Version 2, June 1991 X X Copyright (C) 1989, 1991 Free Software Foundation, Inc. X 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA X Everyone is permitted to copy and distribute verbatim copies X of this license document, but changing it is not allowed. X X Preamble X X The licenses for most software are designed to take away your Xfreedom to share and change it. By contrast, the GNU General Public XLicense is intended to guarantee your freedom to share and change free Xsoftware--to make sure the software is free for all its users. This XGeneral Public License applies to most of the Free Software XFoundation's software and to any other program whose authors commit to Xusing it. (Some other Free Software Foundation software is covered by Xthe GNU Library General Public License instead.) You can apply it to Xyour programs, too. X X When we speak of free software, we are referring to freedom, not Xprice. Our General Public Licenses are designed to make sure that you Xhave the freedom to distribute copies of free software (and charge for Xthis service if you wish), that you receive source code or can get it Xif you want it, that you can change the software or use pieces of it Xin new free programs; and that you know you can do these things. X X To protect your rights, we need to make restrictions that forbid Xanyone to deny you these rights or to ask you to surrender the rights. XThese restrictions translate to certain responsibilities for you if you Xdistribute copies of the software, or if you modify it. X X For example, if you distribute copies of such a program, whether Xgratis or for a fee, you must give the recipients all the rights that Xyou have. You must make sure that they, too, receive or can get the Xsource code. And you must show them these terms so they know their Xrights. X X We protect your rights with two steps: (1) copyright the software, and X(2) offer you this license which gives you legal permission to copy, Xdistribute and/or modify the software. X X Also, for each author's protection and ours, we want to make certain Xthat everyone understands that there is no warranty for this free Xsoftware. If the software is modified by someone else and passed on, we Xwant its recipients to know that what they have is not the original, so Xthat any problems introduced by others will not reflect on the original Xauthors' reputations. X X Finally, any free program is threatened constantly by software Xpatents. We wish to avoid the danger that redistributors of a free Xprogram will individually obtain patent licenses, in effect making the Xprogram proprietary. To prevent this, we have made it clear that any Xpatent must be licensed for everyone's free use or not licensed at all. X X The precise terms and conditions for copying, distribution and Xmodification follow. X X GNU GENERAL PUBLIC LICENSE X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION X X 0. This License applies to any program or other work which contains Xa notice placed by the copyright holder saying it may be distributed Xunder the terms of this General Public License. The "Program", below, Xrefers to any such program or work, and a "work based on the Program" Xmeans either the Program or any derivative work under copyright law: Xthat is to say, a work containing the Program or a portion of it, Xeither verbatim or with modifications and/or translated into another Xlanguage. (Hereinafter, translation is included without limitation in Xthe term "modification".) Each licensee is addressed as "you". X XActivities other than copying, distribution and modification are not Xcovered by this License; they are outside its scope. The act of Xrunning the Program is not restricted, and the output from the Program Xis covered only if its contents constitute a work based on the XProgram (independent of having been made by running the Program). XWhether that is true depends on what the Program does. X X 1. You may copy and distribute verbatim copies of the Program's Xsource code as you receive it, in any medium, provided that you Xconspicuously and appropriately publish on each copy an appropriate Xcopyright notice and disclaimer of warranty; keep intact all the Xnotices that refer to this License and to the absence of any warranty; Xand give any other recipients of the Program a copy of this License Xalong with the Program. X XYou may charge a fee for the physical act of transferring a copy, and Xyou may at your option offer warranty protection in exchange for a fee. X X 2. You may modify your copy or copies of the Program or any portion Xof it, thus forming a work based on the Program, and copy and Xdistribute such modifications or work under the terms of Section 1 Xabove, provided that you also meet all of these conditions: X X a) You must cause the modified files to carry prominent notices X stating that you changed the files and the date of any change. X X b) You must cause any work that you distribute or publish, that in X whole or in part contains or is derived from the Program or any X part thereof, to be licensed as a whole at no charge to all third X parties under the terms of this License. X X c) If the modified program normally reads commands interactively X when run, you must cause it, when started running for such X interactive use in the most ordinary way, to print or display an X announcement including an appropriate copyright notice and a X notice that there is no warranty (or else, saying that you provide X a warranty) and that users may redistribute the program under X these conditions, and telling the user how to view a copy of this X License. (Exception: if the Program itself is interactive but X does not normally print such an announcement, your work based on X the Program is not required to print an announcement.) X XThese requirements apply to the modified work as a whole. If Xidentifiable sections of that work are not derived from the Program, Xand can be reasonably considered independent and separate works in Xthemselves, then this License, and its terms, do not apply to those Xsections when you distribute them as separate works. But when you Xdistribute the same sections as part of a whole which is a work based Xon the Program, the distribution of the whole must be on the terms of Xthis License, whose permissions for other licensees extend to the Xentire whole, and thus to each and every part regardless of who wrote it. X XThus, it is not the intent of this section to claim rights or contest Xyour rights to work written entirely by you; rather, the intent is to Xexercise the right to control the distribution of derivative or Xcollective works based on the Program. X XIn addition, mere aggregation of another work not based on the Program Xwith the Program (or with a work based on the Program) on a volume of Xa storage or distribution medium does not bring the other work under Xthe scope of this License. X X 3. You may copy and distribute the Program (or a work based on it, Xunder Section 2) in object code or executable form under the terms of XSections 1 and 2 above provided that you also do one of the following: X X a) Accompany it with the complete corresponding machine-readable X source code, which must be distributed under the terms of Sections X 1 and 2 above on a medium customarily used for software interchange; or, X X b) Accompany it with a written offer, valid for at least three X years, to give any third party, for a charge no more than your X cost of physically performing source distribution, a complete X machine-readable copy of the corresponding source code, to be X distributed under the terms of Sections 1 and 2 above on a medium X customarily used for software interchange; or, X X c) Accompany it with the information you received as to the offer X to distribute corresponding source code. (This alternative is X allowed only for noncommercial distribution and only if you X received the program in object code or executable form with such X an offer, in accord with Subsection b above.) X XThe source code for a work means the preferred form of the work for Xmaking modifications to it. For an executable work, complete source Xcode means all the source code for all modules it contains, plus any Xassociated interface definition files, plus the scripts used to Xcontrol compilation and installation of the executable. However, as a Xspecial exception, the source code distributed need not include Xanything that is normally distributed (in either source or binary Xform) with the major components (compiler, kernel, and so on) of the Xoperating system on which the executable runs, unless that component Xitself accompanies the executable. X XIf distribution of executable or object code is made by offering Xaccess to copy from a designated place, then offering equivalent Xaccess to copy the source code from the same place counts as Xdistribution of the source code, even though third parties are not Xcompelled to copy the source along with the object code. X X 4. You may not copy, modify, sublicense, or distribute the Program Xexcept as expressly provided under this License. Any attempt Xotherwise to copy, modify, sublicense or distribute the Program is Xvoid, and will automatically terminate your rights under this License. XHowever, parties who have received copies, or rights, from you under Xthis License will not have their licenses terminated so long as such Xparties remain in full compliance. X X 5. You are not required to accept this License, since you have not Xsigned it. However, nothing else grants you permission to modify or Xdistribute the Program or its derivative works. These actions are Xprohibited by law if you do not accept this License. Therefore, by Xmodifying or distributing the Program (or any work based on the XProgram), you indicate your acceptance of this License to do so, and Xall its terms and conditions for copying, distributing or modifying Xthe Program or works based on it. X X 6. Each time you redistribute the Program (or any work based on the XProgram), the recipient automatically receives a license from the Xoriginal licensor to copy, distribute or modify the Program subject to Xthese terms and conditions. You may not impose any further Xrestrictions on the recipients' exercise of the rights granted herein. XYou are not responsible for enforcing compliance by third parties to Xthis License. X X 7. If, as a consequence of a court judgment or allegation of patent Xinfringement or for any other reason (not limited to patent issues), Xconditions are imposed on you (whether by court order, agreement or Xotherwise) that contradict the conditions of this License, they do not Xexcuse you from the conditions of this License. If you cannot Xdistribute so as to satisfy simultaneously your obligations under this XLicense and any other pertinent obligations, then as a consequence you Xmay not distribute the Program at all. For example, if a patent Xlicense would not permit royalty-free redistribution of the Program by Xall those who receive copies directly or indirectly through you, then Xthe only way you could satisfy both it and this License would be to Xrefrain entirely from distribution of the Program. X XIf any portion of this section is held invalid or unenforceable under Xany particular circumstance, the balance of the section is intended to Xapply and the section as a whole is intended to apply in other Xcircumstances. X XIt is not the purpose of this section to induce you to infringe any Xpatents or other property right claims or to contest validity of any Xsuch claims; this section has the sole purpose of protecting the Xintegrity of the free software distribution system, which is Ximplemented by public license practices. Many people have made Xgenerous contributions to the wide range of software distributed Xthrough that system in reliance on consistent application of that Xsystem; it is up to the author/donor to decide if he or she is willing Xto distribute software through any other system and a licensee cannot Ximpose that choice. X XThis section is intended to make thoroughly clear what is believed to Xbe a consequence of the rest of this License. X X 8. If the distribution and/or use of the Program is restricted in Xcertain countries either by patents or by copyrighted interfaces, the Xoriginal copyright holder who places the Program under this License Xmay add an explicit geographical distribution limitation excluding Xthose countries, so that distribution is permitted only in or among Xcountries not thus excluded. In such case, this License incorporates Xthe limitation as if written in the body of this License. X X 9. The Free Software Foundation may publish revised and/or new versions Xof the General Public License from time to time. Such new versions will Xbe similar in spirit to the present version, but may differ in detail to Xaddress new problems or concerns. X XEach version is given a distinguishing version number. If the Program Xspecifies a version number of this License which applies to it and "any Xlater version", you have the option of following the terms and conditions Xeither of that version or of any later version published by the Free XSoftware Foundation. If the Program does not specify a version number of Xthis License, you may choose any version ever published by the Free Software XFoundation. X X 10. If you wish to incorporate parts of the Program into other free Xprograms whose distribution conditions are different, write to the author Xto ask for permission. For software which is copyrighted by the Free XSoftware Foundation, write to the Free Software Foundation; we sometimes Xmake exceptions for this. Our decision will be guided by the two goals Xof preserving the free status of all derivatives of our free software and Xof promoting the sharing and reuse of software generally. X X NO WARRANTY X X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, XREPAIR OR CORRECTION. X X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE XPOSSIBILITY OF SUCH DAMAGES. X X END OF TERMS AND CONDITIONS X X How to Apply These Terms to Your New Programs X X If you develop a new program, and you want it to be of the greatest Xpossible use to the public, the best way to achieve this is to make it Xfree software which everyone can redistribute and change under these terms. X X To do so, attach the following notices to the program. It is safest Xto attach them to the start of each source file to most effectively Xconvey the exclusion of warranty; and each file should have at least Xthe "copyright" line and a pointer to where the full notice is found. X X X Copyright (C) X X This program is free software; you can redistribute it and/or modify X it under the terms of the GNU General Public License as published by X the Free Software Foundation; either version 2 of the License, or X (at your option) any later version. X X This program is distributed in the hope that it will be useful, X but WITHOUT ANY WARRANTY; without even the implied warranty of X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X GNU General Public License for more details. X X You should have received a copy of the GNU General Public License X along with this program; if not, write to the Free Software X Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA X X XAlso add information on how to contact you by electronic and paper mail. X XIf the program is interactive, make it output a short notice like this Xwhen it starts in an interactive mode: X X Gnomovision version 69, Copyright (C) year name of author X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. X This is free software, and you are welcome to redistribute it X under certain conditions; type `show c' for details. X XThe hypothetical commands `show w' and `show c' should show the appropriate Xparts of the General Public License. Of course, the commands you use may Xbe called something other than `show w' and `show c'; they could even be Xmouse-clicks or menu items--whatever suits your program. X XYou should also get your employer (if you work as a programmer) or your Xschool, if any, to sign a "copyright disclaimer" for the program, if Xnecessary. Here is a sample; alter the names: X X Yoyodyne, Inc., hereby disclaims all copyright interest in the program X `Gnomovision' (which makes passes at compilers) written by James Hacker. X X , 1 April 1989 X Ty Coon, President of Vice X XThis General Public License does not permit incorporating your program into Xproprietary programs. If your program is a subroutine library, you may Xconsider it more useful to permit linking proprietary applications with the Xlibrary. If this is what you want to do, use the GNU Library General XPublic License instead of this License. SHAR_EOF : || $echo 'restore of' 'sqlite-g0.2/COPYING' 'failed' fi rm -fr _sh03815 exit 0