summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2007-12-26 21:54:07 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2007-12-26 21:54:07 (GMT)
commitf60b650e9acd449b142c37e4fcc55390c62f4832 (patch) (unidiff)
tree3f3e026b1db43a9344fb65e6a83d7534b7434ff0
parent06e6d0bcfcd33203091a817e4423fdd12e1bcd68 (diff)
downloadgamma-f60b650e9acd449b142c37e4fcc55390c62f4832.tar.gz
gamma-f60b650e9acd449b142c37e4fcc55390c62f4832.tar.bz2
* NEWS: Update.
* configure.ac: Version number 1.1 * COPYING: GPLv3. * Makefile.am: GPLv3. * examples/whoisd.scm: GPLv3. * m4/guile.m4: Require Guile v. 1.8 or later. * scripts/Makefile.am: GPLv3. * scripts/guile-doc-snarf.awk: GPLv3. * src/.cvsignore (gettext.inc, gettext.scm): Remove. * src/Makefile.am: Remove libguile-gettext. * src/app.h: GPLv3. * src/gsql_conn.c, src/gsql_lib.c, src/guile-sql.h, src/mysql.c, src/pgsql.c: GPLv3; Guile v.>=1.8. * src/gettext.sci, src/gettext.h, src/gettext.c: Remove. * src/gettext.scm: New file.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--COPYING898
-rw-r--r--ChangeLog18
-rw-r--r--Makefile.am2
-rw-r--r--NEWS26
-rw-r--r--configure.ac20
-rw-r--r--examples/whoisd.scm15
-rw-r--r--m4/guile.m417
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/guile-doc-snarf.awk14
-rw-r--r--src/.cvsignore3
-rw-r--r--src/Makefile.am19
-rw-r--r--src/app.h13
-rw-r--r--src/gettext.scm29
-rw-r--r--src/gsql_conn.c88
-rw-r--r--src/gsql_lib.c29
-rw-r--r--src/guile-sql.h22
-rw-r--r--src/mysql.c48
-rw-r--r--src/pgsql.c44
18 files changed, 828 insertions, 479 deletions
diff --git a/COPYING b/COPYING
index 623b625..4432540 100644
--- a/COPYING
+++ b/COPYING
@@ -1,284 +1,626 @@
1
1 GNU GENERAL PUBLIC LICENSE 2 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991 3 Version 3, 29 June 2007
3 4
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies 6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed. 7 of this license document, but changing it is not allowed.
8 8
9 Preamble 9 Preamble
10 10
11 The licenses for most software are designed to take away your 11 The GNU General Public License is a free, copyleft license for
12freedom to share and change it. By contrast, the GNU General Public 12software and other kinds of works.
13License is intended to guarantee your freedom to share and change free 13
14software--to make sure the software is free for all its users. This 14 The licenses for most software and other practical works are designed
15General Public License applies to most of the Free Software 15to take away your freedom to share and change the works. By contrast,
16Foundation's software and to any other program whose authors commit to 16the GNU General Public License is intended to guarantee your freedom to
17using it. (Some other Free Software Foundation software is covered by 17share and change all versions of a program--to make sure it remains free
18the GNU Library General Public License instead.) You can apply it to 18software for all its users. We, the Free Software Foundation, use the
19GNU General Public License for most of our software; it applies also to
20any other work released this way by its authors. You can apply it to
19your programs, too. 21your programs, too.
20 22
21 When we speak of free software, we are referring to freedom, not 23 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you 24price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for 25have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it 26them if you wish), that you receive source code or can get it if you
25if you want it, that you can change the software or use pieces of it 27want it, that you can change the software or use pieces of it in new
26in new free programs; and that you know you can do these things. 28free programs, and that you know you can do these things.
27 29
28 To protect your rights, we need to make restrictions that forbid 30 To protect your rights, we need to prevent others from denying you
29anyone to deny you these rights or to ask you to surrender the rights. 31these rights or asking you to surrender the rights. Therefore, you have
30These restrictions translate to certain responsibilities for you if you 32certain responsibilities if you distribute copies of the software, or if
31distribute copies of the software, or if you modify it. 33you modify it: responsibilities to respect the freedom of others.
32 34
33 For example, if you distribute copies of such a program, whether 35 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that 36gratis or for a fee, you must pass on to the recipients the same
35you have. You must make sure that they, too, receive or can get the 37freedoms that you received. You must make sure that they, too, receive
36source code. And you must show them these terms so they know their 38or can get the source code. And you must show them these terms so they
37rights. 39know their rights.
38 40
39 We protect your rights with two steps: (1) copyright the software, and 41 Developers that use the GNU GPL protect your rights with two steps:
40(2) offer you this license which gives you legal permission to copy, 42(1) assert copyright on the software, and (2) offer you this License
41distribute and/or modify the software. 43giving you legal permission to copy, distribute and/or modify it.
42 44
43 Also, for each author's protection and ours, we want to make certain 45 For the developers' and authors' protection, the GPL clearly explains
44that everyone understands that there is no warranty for this free 46that there is no warranty for this free software. For both users' and
45software. If the software is modified by someone else and passed on, we 47authors' sake, the GPL requires that modified versions be marked as
46want its recipients to know that what they have is not the original, so 48changed, so that their problems will not be attributed erroneously to
47that any problems introduced by others will not reflect on the original 49authors of previous versions.
48authors' reputations. 50
49 51 Some devices are designed to deny users access to install or run
50 Finally, any free program is threatened constantly by software 52modified versions of the software inside them, although the manufacturer
51patents. We wish to avoid the danger that redistributors of a free 53can do so. This is fundamentally incompatible with the aim of
52program will individually obtain patent licenses, in effect making the 54protecting users' freedom to change the software. The systematic
53program proprietary. To prevent this, we have made it clear that any 55pattern of such abuse occurs in the area of products for individuals to
54patent must be licensed for everyone's free use or not licensed at all. 56use, which is precisely where it is most unacceptable. Therefore, we
57have designed this version of the GPL to prohibit the practice for those
58products. If such problems arise substantially in other domains, we
59stand ready to extend this provision to those domains in future versions
60of the GPL, as needed to protect the freedom of users.
61
62 Finally, every program is threatened constantly by software patents.
63States should not allow patents to restrict development and use of
64software on general-purpose computers, but in those that do, we wish to
65avoid the special danger that patents applied to a free program could
66make it effectively proprietary. To prevent this, the GPL assures that
67patents cannot be used to render the program non-free.
55 68
56 The precise terms and conditions for copying, distribution and 69 The precise terms and conditions for copying, distribution and
57modification follow. 70modification follow.
58 71
59 GNU GENERAL PUBLIC LICENSE 72 TERMS AND CONDITIONS
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 73
61 74 0. Definitions.
62 0. This License applies to any program or other work which contains 75
63a notice placed by the copyright holder saying it may be distributed 76 "This License" refers to version 3 of the GNU General Public License.
64under the terms of this General Public License. The "Program", below, 77
65refers to any such program or work, and a "work based on the Program" 78 "Copyright" also means copyright-like laws that apply to other kinds of
66means either the Program or any derivative work under copyright law: 79works, such as semiconductor masks.
67that is to say, a work containing the Program or a portion of it, 80
68either verbatim or with modifications and/or translated into another 81 "The Program" refers to any copyrightable work licensed under this
69language. (Hereinafter, translation is included without limitation in 82License. Each licensee is addressed as "you". "Licensees" and
70the term "modification".) Each licensee is addressed as "you". 83"recipients" may be individuals or organizations.
71 84
72Activities other than copying, distribution and modification are not 85 To "modify" a work means to copy from or adapt all or part of the work
73covered by this License; they are outside its scope. The act of 86in a fashion requiring copyright permission, other than the making of an
74running the Program is not restricted, and the output from the Program 87exact copy. The resulting work is called a "modified version" of the
75is covered only if its contents constitute a work based on the 88earlier work or a work "based on" the earlier work.
76Program (independent of having been made by running the Program). 89
77Whether that is true depends on what the Program does. 90 A "covered work" means either the unmodified Program or a work based
78 91on the Program.
79 1. You may copy and distribute verbatim copies of the Program's 92
80source code as you receive it, in any medium, provided that you 93 To "propagate" a work means to do anything with it that, without
81conspicuously and appropriately publish on each copy an appropriate 94permission, would make you directly or secondarily liable for
82copyright notice and disclaimer of warranty; keep intact all the 95infringement under applicable copyright law, except executing it on a
83notices that refer to this License and to the absence of any warranty; 96computer or modifying a private copy. Propagation includes copying,
84and give any other recipients of the Program a copy of this License 97distribution (with or without modification), making available to the
85along with the Program. 98public, and in some countries other activities as well.
86 99
87You may charge a fee for the physical act of transferring a copy, and 100 To "convey" a work means any kind of propagation that enables other
88you may at your option offer warranty protection in exchange for a fee. 101parties to make or receive copies. Mere interaction with a user through
89 102a computer network, with no transfer of a copy, is not conveying.
90 2. You may modify your copy or copies of the Program or any portion 103
91of it, thus forming a work based on the Program, and copy and 104 An interactive user interface displays "Appropriate Legal Notices"
92distribute such modifications or work under the terms of Section 1 105to the extent that it includes a convenient and prominently visible
93above, provided that you also meet all of these conditions: 106feature that (1) displays an appropriate copyright notice, and (2)
94 107tells the user that there is no warranty for the work (except to the
95 a) You must cause the modified files to carry prominent notices 108extent that warranties are provided), that licensees may convey the
96 stating that you changed the files and the date of any change. 109work under this License, and how to view a copy of this License. If
97 110the interface presents a list of user commands or options, such as a
98 b) You must cause any work that you distribute or publish, that in 111menu, a prominent item in the list meets this criterion.
99 whole or in part contains or is derived from the Program or any 112
100 part thereof, to be licensed as a whole at no charge to all third 113 1. Source Code.
101 parties under the terms of this License. 114
102 115 The "source code" for a work means the preferred form of the work
103 c) If the modified program normally reads commands interactively 116for making modifications to it. "Object code" means any non-source
104 when run, you must cause it, when started running for such 117form of a work.
105 interactive use in the most ordinary way, to print or display an 118
106 announcement including an appropriate copyright notice and a 119 A "Standard Interface" means an interface that either is an official
107 notice that there is no warranty (or else, saying that you provide 120standard defined by a recognized standards body, or, in the case of
108 a warranty) and that users may redistribute the program under 121interfaces specified for a particular programming language, one that
109 these conditions, and telling the user how to view a copy of this 122is widely used among developers working in that language.
110 License. (Exception: if the Program itself is interactive but 123
111 does not normally print such an announcement, your work based on 124 The "System Libraries" of an executable work include anything, other
112 the Program is not required to print an announcement.) 125than the work as a whole, that (a) is included in the normal form of
113 126packaging a Major Component, but which is not part of that Major
114These requirements apply to the modified work as a whole. If 127Component, and (b) serves only to enable use of the work with that
115identifiable sections of that work are not derived from the Program, 128Major Component, or to implement a Standard Interface for which an
116and can be reasonably considered independent and separate works in 129implementation is available to the public in source code form. A
117themselves, then this License, and its terms, do not apply to those 130"Major Component", in this context, means a major essential component
118sections when you distribute them as separate works. But when you 131(kernel, window system, and so on) of the specific operating system
119distribute the same sections as part of a whole which is a work based 132(if any) on which the executable work runs, or a compiler used to
120on the Program, the distribution of the whole must be on the terms of 133produce the work, or an object code interpreter used to run it.
121this License, whose permissions for other licensees extend to the 134
122entire whole, and thus to each and every part regardless of who wrote it. 135 The "Corresponding Source" for a work in object code form means all
123 136the source code needed to generate, install, and (for an executable
124Thus, it is not the intent of this section to claim rights or contest 137work) run the object code and to modify the work, including scripts to
125your rights to work written entirely by you; rather, the intent is to 138control those activities. However, it does not include the work's
126exercise the right to control the distribution of derivative or 139System Libraries, or general-purpose tools or generally available free
127collective works based on the Program. 140programs which are used unmodified in performing those activities but
128 141which are not part of the work. For example, Corresponding Source
129In addition, mere aggregation of another work not based on the Program 142includes interface definition files associated with source files for
130with the Program (or with a work based on the Program) on a volume of 143the work, and the source code for shared libraries and dynamically
131a storage or distribution medium does not bring the other work under 144linked subprograms that the work is specifically designed to require,
132the scope of this License. 145such as by intimate data communication or control flow between those
133 146subprograms and other parts of the work.
134 3. You may copy and distribute the Program (or a work based on it, 147
135under Section 2) in object code or executable form under the terms of 148 The Corresponding Source need not include anything that users
136Sections 1 and 2 above provided that you also do one of the following: 149can regenerate automatically from other parts of the Corresponding
137 150Source.
138 a) Accompany it with the complete corresponding machine-readable 151
139 source code, which must be distributed under the terms of Sections 152 The Corresponding Source for a work in source code form is that
140 1 and 2 above on a medium customarily used for software interchange; or, 153same work.
141 154
142 b) Accompany it with a written offer, valid for at least three 155 2. Basic Permissions.
143 years, to give any third party, for a charge no more than your 156
144 cost of physically performing source distribution, a complete 157 All rights granted under this License are granted for the term of
145 machine-readable copy of the corresponding source code, to be 158copyright on the Program, and are irrevocable provided the stated
146 distributed under the terms of Sections 1 and 2 above on a medium 159conditions are met. This License explicitly affirms your unlimited
147 customarily used for software interchange; or, 160permission to run the unmodified Program. The output from running a
148 161covered work is covered by this License only if the output, given its
149 c) Accompany it with the information you received as to the offer 162content, constitutes a covered work. This License acknowledges your
150 to distribute corresponding source code. (This alternative is 163rights of fair use or other equivalent, as provided by copyright law.
151 allowed only for noncommercial distribution and only if you 164
152 received the program in object code or executable form with such 165 You may make, run and propagate covered works that you do not
153 an offer, in accord with Subsection b above.) 166convey, without conditions so long as your license otherwise remains
154 167in force. You may convey covered works to others for the sole purpose
155The source code for a work means the preferred form of the work for 168of having them make modifications exclusively for you, or provide you
156making modifications to it. For an executable work, complete source 169with facilities for running those works, provided that you comply with
157code means all the source code for all modules it contains, plus any 170the terms of this License in conveying all material for which you do
158associated interface definition files, plus the scripts used to 171not control copyright. Those thus making or running the covered works
159control compilation and installation of the executable. However, as a 172for you must do so exclusively on your behalf, under your direction
160special exception, the source code distributed need not include 173and control, on terms that prohibit them from making any copies of
161anything that is normally distributed (in either source or binary 174your copyrighted material outside their relationship with you.
162form) with the major components (compiler, kernel, and so on) of the 175
163operating system on which the executable runs, unless that component 176 Conveying under any other circumstances is permitted solely under
164itself accompanies the executable. 177the conditions stated below. Sublicensing is not allowed; section 10
165 178makes it unnecessary.
166If distribution of executable or object code is made by offering 179
167access to copy from a designated place, then offering equivalent 180 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168access to copy the source code from the same place counts as 181
169distribution of the source code, even though third parties are not 182 No covered work shall be deemed part of an effective technological
170compelled to copy the source along with the object code. 183measure under any applicable law fulfilling obligations under article
171 18411 of the WIPO copyright treaty adopted on 20 December 1996, or
172 4. You may not copy, modify, sublicense, or distribute the Program 185similar laws prohibiting or restricting circumvention of such
173except as expressly provided under this License. Any attempt 186measures.
174otherwise to copy, modify, sublicense or distribute the Program is 187
175void, and will automatically terminate your rights under this License. 188 When you convey a covered work, you waive any legal power to forbid
176However, parties who have received copies, or rights, from you under 189circumvention of technological measures to the extent such circumvention
177this License will not have their licenses terminated so long as such 190is effected by exercising rights under this License with respect to
178parties remain in full compliance. 191the covered work, and you disclaim any intention to limit operation or
179 192modification of the work as a means of enforcing, against the work's
180 5. You are not required to accept this License, since you have not 193users, your or third parties' legal rights to forbid circumvention of
181signed it. However, nothing else grants you permission to modify or 194technological measures.
182distribute the Program or its derivative works. These actions are 195
183prohibited by law if you do not accept this License. Therefore, by 196 4. Conveying Verbatim Copies.
184modifying or distributing the Program (or any work based on the 197
185Program), you indicate your acceptance of this License to do so, and 198 You may convey verbatim copies of the Program's source code as you
186all its terms and conditions for copying, distributing or modifying 199receive it, in any medium, provided that you conspicuously and
187the Program or works based on it. 200appropriately publish on each copy an appropriate copyright notice;
188 201keep intact all notices stating that this License and any
189 6. Each time you redistribute the Program (or any work based on the 202non-permissive terms added in accord with section 7 apply to the code;
190Program), the recipient automatically receives a license from the 203keep intact all notices of the absence of any warranty; and give all
191original licensor to copy, distribute or modify the Program subject to 204recipients a copy of this License along with the Program.
192these terms and conditions. You may not impose any further 205
193restrictions on the recipients' exercise of the rights granted herein. 206 You may charge any price or no price for each copy that you convey,
194You are not responsible for enforcing compliance by third parties to 207and you may offer support or warranty protection for a fee.
208
209 5. Conveying Modified Source Versions.
210
211 You may convey a work based on the Program, or the modifications to
212produce it from the Program, in the form of source code under the
213terms of section 4, provided that you also meet all of these conditions:
214
215 a) The work must carry prominent notices stating that you modified
216 it, and giving a relevant date.
217
218 b) The work must carry prominent notices stating that it is
219 released under this License and any conditions added under section
220 7. This requirement modifies the requirement in section 4 to
221 "keep intact all notices".
222
223 c) You must license the entire work, as a whole, under this
224 License to anyone who comes into possession of a copy. This
225 License will therefore apply, along with any applicable section 7
226 additional terms, to the whole of the work, and all its parts,
227 regardless of how they are packaged. This License gives no
228 permission to license the work in any other way, but it does not
229 invalidate such permission if you have separately received it.
230
231 d) If the work has interactive user interfaces, each must display
232 Appropriate Legal Notices; however, if the Program has interactive
233 interfaces that do not display Appropriate Legal Notices, your
234 work need not make them do so.
235
236 A compilation of a covered work with other separate and independent
237works, which are not by their nature extensions of the covered work,
238and which are not combined with it such as to form a larger program,
239in or on a volume of a storage or distribution medium, is called an
240"aggregate" if the compilation and its resulting copyright are not
241used to limit the access or legal rights of the compilation's users
242beyond what the individual works permit. Inclusion of a covered work
243in an aggregate does not cause this License to apply to the other
244parts of the aggregate.
245
246 6. Conveying Non-Source Forms.
247
248 You may convey a covered work in object code form under the terms
249of sections 4 and 5, provided that you also convey the
250machine-readable Corresponding Source under the terms of this License,
251in one of these ways:
252
253 a) Convey the object code in, or embodied in, a physical product
254 (including a physical distribution medium), accompanied by the
255 Corresponding Source fixed on a durable physical medium
256 customarily used for software interchange.
257
258 b) Convey the object code in, or embodied in, a physical product
259 (including a physical distribution medium), accompanied by a
260 written offer, valid for at least three years and valid for as
261 long as you offer spare parts or customer support for that product
262 model, to give anyone who possesses the object code either (1) a
263 copy of the Corresponding Source for all the software in the
264 product that is covered by this License, on a durable physical
265 medium customarily used for software interchange, for a price no
266 more than your reasonable cost of physically performing this
267 conveying of source, or (2) access to copy the
268 Corresponding Source from a network server at no charge.
269
270 c) Convey individual copies of the object code with a copy of the
271 written offer to provide the Corresponding Source. This
272 alternative is allowed only occasionally and noncommercially, and
273 only if you received the object code with such an offer, in accord
274 with subsection 6b.
275
276 d) Convey the object code by offering access from a designated
277 place (gratis or for a charge), and offer equivalent access to the
278 Corresponding Source in the same way through the same place at no
279 further charge. You need not require recipients to copy the
280 Corresponding Source along with the object code. If the place to
281 copy the object code is a network server, the Corresponding Source
282 may be on a different server (operated by you or a third party)
283 that supports equivalent copying facilities, provided you maintain
284 clear directions next to the object code saying where to find the
285 Corresponding Source. Regardless of what server hosts the
286 Corresponding Source, you remain obligated to ensure that it is
287 available for as long as needed to satisfy these requirements.
288
289 e) Convey the object code using peer-to-peer transmission, provided
290 you inform other peers where the object code and Corresponding
291 Source of the work are being offered to the general public at no
292 charge under subsection 6d.
293
294 A separable portion of the object code, whose source code is excluded
295from the Corresponding Source as a System Library, need not be
296included in conveying the object code work.
297
298 A "User Product" is either (1) a "consumer product", which means any
299tangible personal property which is normally used for personal, family,
300or household purposes, or (2) anything designed or sold for incorporation
301into a dwelling. In determining whether a product is a consumer product,
302doubtful cases shall be resolved in favor of coverage. For a particular
303product received by a particular user, "normally used" refers to a
304typical or common use of that class of product, regardless of the status
305of the particular user or of the way in which the particular user
306actually uses, or expects or is expected to use, the product. A product
307is a consumer product regardless of whether the product has substantial
308commercial, industrial or non-consumer uses, unless such uses represent
309the only significant mode of use of the product.
310
311 "Installation Information" for a User Product means any methods,
312procedures, authorization keys, or other information required to install
313and execute modified versions of a covered work in that User Product from
314a modified version of its Corresponding Source. The information must
315suffice to ensure that the continued functioning of the modified object
316code is in no case prevented or interfered with solely because
317modification has been made.
318
319 If you convey an object code work under this section in, or with, or
320specifically for use in, a User Product, and the conveying occurs as
321part of a transaction in which the right of possession and use of the
322User Product is transferred to the recipient in perpetuity or for a
323fixed term (regardless of how the transaction is characterized), the
324Corresponding Source conveyed under this section must be accompanied
325by the Installation Information. But this requirement does not apply
326if neither you nor any third party retains the ability to install
327modified object code on the User Product (for example, the work has
328been installed in ROM).
329
330 The requirement to provide Installation Information does not include a
331requirement to continue to provide support service, warranty, or updates
332for a work that has been modified or installed by the recipient, or for
333the User Product in which it has been modified or installed. Access to a
334network may be denied when the modification itself materially and
335adversely affects the operation of the network or violates the rules and
336protocols for communication across the network.
337
338 Corresponding Source conveyed, and Installation Information provided,
339in accord with this section must be in a format that is publicly
340documented (and with an implementation available to the public in
341source code form), and must require no special password or key for
342unpacking, reading or copying.
343
344 7. Additional Terms.
345
346 "Additional permissions" are terms that supplement the terms of this
347License by making exceptions from one or more of its conditions.
348Additional permissions that are applicable to the entire Program shall
349be treated as though they were included in this License, to the extent
350that they are valid under applicable law. If additional permissions
351apply only to part of the Program, that part may be used separately
352under those permissions, but the entire Program remains governed by
353this License without regard to the additional permissions.
354
355 When you convey a copy of a covered work, you may at your option
356remove any additional permissions from that copy, or from any part of
357it. (Additional permissions may be written to require their own
358removal in certain cases when you modify the work.) You may place
359additional permissions on material, added by you to a covered work,
360for which you have or can give appropriate copyright permission.
361
362 Notwithstanding any other provision of this License, for material you
363add to a covered work, you may (if authorized by the copyright holders of
364that material) supplement the terms of this License with terms:
365
366 a) Disclaiming warranty or limiting liability differently from the
367 terms of sections 15 and 16 of this License; or
368
369 b) Requiring preservation of specified reasonable legal notices or
370 author attributions in that material or in the Appropriate Legal
371 Notices displayed by works containing it; or
372
373 c) Prohibiting misrepresentation of the origin of that material, or
374 requiring that modified versions of such material be marked in
375 reasonable ways as different from the original version; or
376
377 d) Limiting the use for publicity purposes of names of licensors or
378 authors of the material; or
379
380 e) Declining to grant rights under trademark law for use of some
381 trade names, trademarks, or service marks; or
382
383 f) Requiring indemnification of licensors and authors of that
384 material by anyone who conveys the material (or modified versions of
385 it) with contractual assumptions of liability to the recipient, for
386 any liability that these contractual assumptions directly impose on
387 those licensors and authors.
388
389 All other non-permissive additional terms are considered "further
390restrictions" within the meaning of section 10. If the Program as you
391received it, or any part of it, contains a notice stating that it is
392governed by this License along with a term that is a further
393restriction, you may remove that term. If a license document contains
394a further restriction but permits relicensing or conveying under this
395License, you may add to a covered work material governed by the terms
396of that license document, provided that the further restriction does
397not survive such relicensing or conveying.
398
399 If you add terms to a covered work in accord with this section, you
400must place, in the relevant source files, a statement of the
401additional terms that apply to those files, or a notice indicating
402where to find the applicable terms.
403
404 Additional terms, permissive or non-permissive, may be stated in the
405form of a separately written license, or stated as exceptions;
406the above requirements apply either way.
407
408 8. Termination.
409
410 You may not propagate or modify a covered work except as expressly
411provided under this License. Any attempt otherwise to propagate or
412modify it is void, and will automatically terminate your rights under
413this License (including any patent licenses granted under the third
414paragraph of section 11).
415
416 However, if you cease all violation of this License, then your
417license from a particular copyright holder is reinstated (a)
418provisionally, unless and until the copyright holder explicitly and
419finally terminates your license, and (b) permanently, if the copyright
420holder fails to notify you of the violation by some reasonable means
421prior to 60 days after the cessation.
422
423 Moreover, your license from a particular copyright holder is
424reinstated permanently if the copyright holder notifies you of the
425violation by some reasonable means, this is the first time you have
426received notice of violation of this License (for any work) from that
427copyright holder, and you cure the violation prior to 30 days after
428your receipt of the notice.
429
430 Termination of your rights under this section does not terminate the
431licenses of parties who have received copies or rights from you under
432this License. If your rights have been terminated and not permanently
433reinstated, you do not qualify to receive new licenses for the same
434material under section 10.
435
436 9. Acceptance Not Required for Having Copies.
437
438 You are not required to accept this License in order to receive or
439run a copy of the Program. Ancillary propagation of a covered work
440occurring solely as a consequence of using peer-to-peer transmission
441to receive a copy likewise does not require acceptance. However,
442nothing other than this License grants you permission to propagate or
443modify any covered work. These actions infringe copyright if you do
444not accept this License. Therefore, by modifying or propagating a
445covered work, you indicate your acceptance of this License to do so.
446
447 10. Automatic Licensing of Downstream Recipients.
448
449 Each time you convey a covered work, the recipient automatically
450receives a license from the original licensors, to run, modify and
451propagate that work, subject to this License. You are not responsible
452for enforcing compliance by third parties with this License.
453
454 An "entity transaction" is a transaction transferring control of an
455organization, or substantially all assets of one, or subdividing an
456organization, or merging organizations. If propagation of a covered
457work results from an entity transaction, each party to that
458transaction who receives a copy of the work also receives whatever
459licenses to the work the party's predecessor in interest had or could
460give under the previous paragraph, plus a right to possession of the
461Corresponding Source of the work from the predecessor in interest, if
462the predecessor has it or can get it with reasonable efforts.
463
464 You may not impose any further restrictions on the exercise of the
465rights granted or affirmed under this License. For example, you may
466not impose a license fee, royalty, or other charge for exercise of
467rights granted under this License, and you may not initiate litigation
468(including a cross-claim or counterclaim in a lawsuit) alleging that
469any patent claim is infringed by making, using, selling, offering for
470sale, or importing the Program or any portion of it.
471
472 11. Patents.
473
474 A "contributor" is a copyright holder who authorizes use under this
475License of the Program or a work on which the Program is based. The
476work thus licensed is called the contributor's "contributor version".
477
478 A contributor's "essential patent claims" are all patent claims
479owned or controlled by the contributor, whether already acquired or
480hereafter acquired, that would be infringed by some manner, permitted
481by this License, of making, using, or selling its contributor version,
482but do not include claims that would be infringed only as a
483consequence of further modification of the contributor version. For
484purposes of this definition, "control" includes the right to grant
485patent sublicenses in a manner consistent with the requirements of
195this License. 486this License.
196 487
197 7. If, as a consequence of a court judgment or allegation of patent 488 Each contributor grants you a non-exclusive, worldwide, royalty-free
198infringement or for any other reason (not limited to patent issues), 489patent license under the contributor's essential patent claims, to
199conditions are imposed on you (whether by court order, agreement or 490make, use, sell, offer for sale, import and otherwise run, modify and
491propagate the contents of its contributor version.
492
493 In the following three paragraphs, a "patent license" is any express
494agreement or commitment, however denominated, not to enforce a patent
495(such as an express permission to practice a patent or covenant not to
496sue for patent infringement). To "grant" such a patent license to a
497party means to make such an agreement or commitment not to enforce a
498patent against the party.
499
500 If you convey a covered work, knowingly relying on a patent license,
501and the Corresponding Source of the work is not available for anyone
502to copy, free of charge and under the terms of this License, through a
503publicly available network server or other readily accessible means,
504then you must either (1) cause the Corresponding Source to be so
505available, or (2) arrange to deprive yourself of the benefit of the
506patent license for this particular work, or (3) arrange, in a manner
507consistent with the requirements of this License, to extend the patent
508license to downstream recipients. "Knowingly relying" means you have
509actual knowledge that, but for the patent license, your conveying the
510covered work in a country, or your recipient's use of the covered work
511in a country, would infringe one or more identifiable patents in that
512country that you have reason to believe are valid.
513
514 If, pursuant to or in connection with a single transaction or
515arrangement, you convey, or propagate by procuring conveyance of, a
516covered work, and grant a patent license to some of the parties
517receiving the covered work authorizing them to use, propagate, modify
518or convey a specific copy of the covered work, then the patent license
519you grant is automatically extended to all recipients of the covered
520work and works based on it.
521
522 A patent license is "discriminatory" if it does not include within
523the scope of its coverage, prohibits the exercise of, or is
524conditioned on the non-exercise of one or more of the rights that are
525specifically granted under this License. You may not convey a covered
526work if you are a party to an arrangement with a third party that is
527in the business of distributing software, under which you make payment
528to the third party based on the extent of your activity of conveying
529the work, and under which the third party grants, to any of the
530parties who would receive the covered work from you, a discriminatory
531patent license (a) in connection with copies of the covered work
532conveyed by you (or copies made from those copies), or (b) primarily
533for and in connection with specific products or compilations that
534contain the covered work, unless you entered into that arrangement,
535or that patent license was granted, prior to 28 March 2007.
536
537 Nothing in this License shall be construed as excluding or limiting
538any implied license or other defenses to infringement that may
539otherwise be available to you under applicable patent law.
540
541 12. No Surrender of Others' Freedom.
542
543 If conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not 544otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot 545excuse you from the conditions of this License. If you cannot convey a
202distribute so as to satisfy simultaneously your obligations under this 546covered work so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you 547License and any other pertinent obligations, then as a consequence you may
204may not distribute the Program at all. For example, if a patent 548not convey it at all. For example, if you agree to terms that obligate you
205license would not permit royalty-free redistribution of the Program by 549to collect a royalty for further conveying from those to whom you convey
206all those who receive copies directly or indirectly through you, then 550the Program, the only way you could satisfy both those terms and this
207the only way you could satisfy both it and this License would be to 551License would be to refrain entirely from conveying the Program.
208refrain entirely from distribution of the Program. 552
209 553 13. Use with the GNU Affero General Public License.
210If any portion of this section is held invalid or unenforceable under 554
211any particular circumstance, the balance of the section is intended to 555 Notwithstanding any other provision of this License, you have
212apply and the section as a whole is intended to apply in other 556permission to link or combine any covered work with a work licensed
213circumstances. 557under version 3 of the GNU Affero General Public License into a single
214 558combined work, and to convey the resulting work. The terms of this
215It is not the purpose of this section to induce you to infringe any 559License will continue to apply to the part which is the covered work,
216patents or other property right claims or to contest validity of any 560but the special requirements of the GNU Affero General Public License,
217such claims; this section has the sole purpose of protecting the 561section 13, concerning interaction through a network will apply to the
218integrity of the free software distribution system, which is 562combination as such.
219implemented by public license practices. Many people have made 563
220generous contributions to the wide range of software distributed 564 14. Revised Versions of this License.
221through that system in reliance on consistent application of that 565
222system; it is up to the author/donor to decide if he or she is willing 566 The Free Software Foundation may publish revised and/or new versions of
223to distribute software through any other system and a licensee cannot 567the GNU General Public License from time to time. Such new versions will
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to 568be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns. 569address new problems or concerns.
241 570
242Each version is given a distinguishing version number. If the Program 571 Each version is given a distinguishing version number. If the
243specifies a version number of this License which applies to it and "any 572Program specifies that a certain numbered version of the GNU General
244later version", you have the option of following the terms and conditions 573Public License "or any later version" applies to it, you have the
245either of that version or of any later version published by the Free 574option of following the terms and conditions either of that numbered
246Software Foundation. If the Program does not specify a version number of 575version or of any later version published by the Free Software
247this License, you may choose any version ever published by the Free Software 576Foundation. If the Program does not specify a version number of the
248Foundation. 577GNU General Public License, you may choose any version ever published
249 578by the Free Software Foundation.
250 10. If you wish to incorporate parts of the Program into other free 579
251programs whose distribution conditions are different, write to the author 580 If the Program specifies that a proxy can decide which future
252to ask for permission. For software which is copyrighted by the Free 581versions of the GNU General Public License can be used, that proxy's
253Software Foundation, write to the Free Software Foundation; we sometimes 582public statement of acceptance of a version permanently authorizes you
254make exceptions for this. Our decision will be guided by the two goals 583to choose that version for the Program.
255of preserving the free status of all derivatives of our free software and 584
256of promoting the sharing and reuse of software generally. 585 Later license versions may give you additional or different
257 586permissions. However, no additional obligations are imposed on any
258 NO WARRANTY 587author or copyright holder as a result of your choosing to follow a
259 588later version.
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 589
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 590 15. Disclaimer of Warranty.
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 591
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 592 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 593APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 594HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 595OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 596THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
268REPAIR OR CORRECTION. 597PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
269 598IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 599ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 600
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 601 16. Limitation of Liability.
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 602
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 603 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 604WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 605THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 606GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
278POSSIBILITY OF SUCH DAMAGES. 607USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
608DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
609PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
610EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
611SUCH DAMAGES.
612
613 17. Interpretation of Sections 15 and 16.
614
615 If the disclaimer of warranty and limitation of liability provided
616above cannot be given local legal effect according to their terms,
617reviewing courts shall apply local law that most closely approximates
618an absolute waiver of all civil liability in connection with the
619Program, unless a warranty or assumption of liability accompanies a
620copy of the Program in return for a fee.
279 621
280 END OF TERMS AND CONDITIONS 622 END OF TERMS AND CONDITIONS
281 623
282 How to Apply These Terms to Your New Programs 624 How to Apply These Terms to Your New Programs
283 625
284 If you develop a new program, and you want it to be of the greatest 626 If you develop a new program, and you want it to be of the greatest
@@ -287,15 +629,15 @@ free software which everyone can redistribute and change under these terms.
287 629
288 To do so, attach the following notices to the program. It is safest 630 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively 631to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least 632state the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found. 633the "copyright" line and a pointer to where the full notice is found.
292 634
293 <one line to give the program's name and a brief idea of what it does.> 635 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author> 636 Copyright (C) <year> <name of author>
295 637
296 This program is free software; you can redistribute it and/or modify 638 This program is free software: you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by 639 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or 640 the Free Software Foundation, either version 3 of the License, or
299 (at your option) any later version. 641 (at your option) any later version.
300 642
301 This program is distributed in the hope that it will be useful, 643 This program is distributed in the hope that it will be useful,
@@ -304,37 +646,31 @@ the "copyright" line and a pointer to where the full notice is found.
304 GNU General Public License for more details. 646 GNU General Public License for more details.
305 647
306 You should have received a copy of the GNU General Public License 648 You should have received a copy of the GNU General Public License
307 along with this program; if not, write to the Free Software 649 along with this program. If not, see <http://www.gnu.org/licenses/>.
308 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
309
310 650
311Also add information on how to contact you by electronic and paper mail. 651Also add information on how to contact you by electronic and paper mail.
312 652
313If the program is interactive, make it output a short notice like this 653 If the program does terminal interaction, make it output a short
314when it starts in an interactive mode: 654notice like this when it starts in an interactive mode:
315 655
316 Gnomovision version 69, Copyright (C) year name of author 656 <program> Copyright (C) <year> <name of author>
317 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318 This is free software, and you are welcome to redistribute it 658 This is free software, and you are welcome to redistribute it
319 under certain conditions; type `show c' for details. 659 under certain conditions; type `show c' for details.
320 660
321The hypothetical commands `show w' and `show c' should show the appropriate 661The hypothetical commands `show w' and `show c' should show the appropriate
322parts of the General Public License. Of course, the commands you use may 662parts of the General Public License. Of course, your program's commands
323be called something other than `show w' and `show c'; they could even be 663might be different; for a GUI interface, you would use an "about box".
324mouse-clicks or menu items--whatever suits your program.
325
326You should also get your employer (if you work as a programmer) or your
327school, if any, to sign a "copyright disclaimer" for the program, if
328necessary. Here is a sample; alter the names:
329 664
330 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 665 You should also get your employer (if you work as a programmer) or school,
331 `Gnomovision' (which makes passes at compilers) written by James Hacker. 666if any, to sign a "copyright disclaimer" for the program, if necessary.
667For more information on this, and how to apply and follow the GNU GPL, see
668<http://www.gnu.org/licenses/>.
332 669
333 <signature of Ty Coon>, 1 April 1989 670 The GNU General Public License does not permit incorporating your program
334 Ty Coon, President of Vice 671into proprietary programs. If your program is a subroutine library, you
672may consider it more useful to permit linking proprietary applications with
673the library. If this is what you want to do, use the GNU Lesser General
674Public License instead of this License. But first, please read
675<http://www.gnu.org/philosophy/why-not-lgpl.html>.
335 676
336This General Public License does not permit incorporating your program into
337proprietary programs. If your program is a subroutine library, you may
338consider it more useful to permit linking proprietary applications with the
339library. If this is what you want to do, use the GNU Library General
340Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
index bf70a0d..e42102e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
12007-12-26 Sergey Poznyakoff <gray@gnu.org.ua>
2
3 * NEWS: Update.
4 * configure.ac: Version number 1.1
5 * COPYING: GPLv3.
6 * Makefile.am: GPLv3.
7 * examples/whoisd.scm: GPLv3.
8 * m4/guile.m4: Require Guile v. 1.8 or later.
9 * scripts/Makefile.am: GPLv3.
10 * scripts/guile-doc-snarf.awk: GPLv3.
11 * src/.cvsignore (gettext.inc, gettext.scm): Remove.
12 * src/Makefile.am: Remove libguile-gettext.
13 * src/app.h: GPLv3.
14 * src/gsql_conn.c, src/gsql_lib.c, src/guile-sql.h, src/mysql.c,
15 src/pgsql.c: GPLv3; Guile v.>=1.8.
16 * src/gettext.sci, src/gettext.h, src/gettext.c: Remove.
17 * src/gettext.scm: New file.
18
12006-10-12 Sergey Poznyakoff <gray@gnu.org.ua> 192006-10-12 Sergey Poznyakoff <gray@gnu.org.ua>
2 20
3 * src/mysql.c (s_mysql_free): Bugfix: mysql was freed twice 21 * src/mysql.c (s_mysql_free): Bugfix: mysql was freed twice
diff --git a/Makefile.am b/Makefile.am
index e8b574e..482c447 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
1# This file is part of guile-sql. 1# This file is part of guile-sql.
2# Copyright (C) 2002, Sergey Poznyakoff 2# Copyright (C) 2002, 2007, Sergey Poznyakoff
3# 3#
4# This file is free software; as a special exception the author gives 4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without 5# unlimited permission to copy and/or distribute it, with or without
diff --git a/NEWS b/NEWS
index 63a9822..620cbc5 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,22 @@
1Gamma NEWS -- history of user-visible changes. 2004-10-02 1Gamma NEWS -- history of user-visible changes. 2007-12-26
2Copyright (C) 2004 Sergey Poznyakoff 2Copyright (C) 2004, 2007 Sergey Poznyakoff
3See the end of file for copying conditions. 3See the end of file for copying conditions.
4 4
5Please send radius bug reports to <gray@gnu.org> 5Please send radius bug reports to <gray@gnu.org.ua>
6
7
8Version 1.1 (CVS)
9
10* Licensed under GPLv3.
11
12* This version requires Guile 1.8 or later.
13
14* Gettext module.
15
16Guile 1.8 already contains all gettext functions. Therefore,
17(gamma gettext) module is largely reduced and contains only
18the definitions of (_) and (N_) functions.
19
6^L 20^L
7Version 1.0: 21Version 1.0:
8 22
@@ -14,7 +28,7 @@ PostgreSQL.
14========================================================================= 28=========================================================================
15Copyright information: 29Copyright information:
16 30
17Copyright (C) 2004 Sergey Poznyakoff 31Copyright (C) 2004, 2007 Sergey Poznyakoff
18 32
19 Permission is granted to anyone to make or distribute verbatim copies 33 Permission is granted to anyone to make or distribute verbatim copies
20 of this document as received, in any medium, provided that the 34 of this document as received, in any medium, provided that the
@@ -29,5 +43,9 @@ Copyright (C) 2004 Sergey Poznyakoff
29Local variables: 43Local variables:
30mode: outline 44mode: outline
31 paragraph-separate: "[ ]*$" 45 paragraph-separate: "[ ]*$"
46eval: (add-hook 'write-file-hooks 'time-stamp)
47time-stamp-start: "changes. "
48time-stamp-format: "%:y-%02m-%02d"
49time-stamp-end: "\n"
32end: 50end:
33 51
diff --git a/configure.ac b/configure.ac
index 7e18fda..1262460 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,25 +1,24 @@
1dnl This file is part of Gamma 1dnl This file is part of Gamma
2dnl Copyright (C) 2002,2004 Sergey Poznyakoff 2dnl Copyright (C) 2002, 2004, 2007 Sergey Poznyakoff
3dnl 3dnl
4dnl This program is free software; you can redistribute it and/or modify 4dnl This program is free software; you can redistribute it and/or modify it
5dnl it under the terms of the GNU General Public License as published by 5dnl under the terms of the GNU General Public License as published by the
6dnl the Free Software Foundation; either version 2 of the License, or 6dnl Free Software Foundation; either version 3 of the License, or (at your
7dnl (at your option) any later version. 7dnl option) any later version.
8dnl 8dnl
9dnl This program is distributed in the hope that it will be useful, 9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details. 12dnl GNU General Public License for more details.
13dnl 13dnl
14dnl You should have received a copy of the GNU General Public License 14dnl You should have received a copy of the GNU General Public License along
15dnl along with this program; if not, write to the Free Software Foundation, 15dnl with this program. If not, see <http://www.gnu.org/licenses/>. */
16dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18dnl Process this file with autoconf to produce a configure script. 17dnl Process this file with autoconf to produce a configure script.
19 18
20AC_PREREQ(2.59) 19AC_PREREQ(2.59)
21 20
22AC_INIT(gamma, 0.2, gray@mirddin.farlep.net) 21AC_INIT(gamma, 1.1, [gray@gnu.org.ua])
23AC_CONFIG_SRCDIR(src/guile-sql.h) 22AC_CONFIG_SRCDIR(src/guile-sql.h)
24AC_CONFIG_AUX_DIR([scripts]) 23AC_CONFIG_AUX_DIR([scripts])
25AC_CANONICAL_SYSTEM 24AC_CANONICAL_SYSTEM
@@ -115,10 +114,7 @@ if test $mu_cv_lib_guile = yes; then
115fi 114fi
116 115
117if test x"$USE_NLS" != x; then 116if test x"$USE_NLS" != x; then
118 BUILD_LIBS="$BUILD_LIBS \$(LIB_GETTEXT)"
119 BUILD_DATA="$BUILD_DATA \$(SCM_GETTEXT)" 117 BUILD_DATA="$BUILD_DATA \$(SCM_GETTEXT)"
120 BUILD_X="$BUILD_X \$(X_GETTEXT)"
121 INSTALL_HOOKS="$INSTALL_HOOKS install-gettext-hook"
122fi 118fi
123 119
124if test x"$BUILD_LIBS" = x; then 120if test x"$BUILD_LIBS" = x; then
diff --git a/examples/whoisd.scm b/examples/whoisd.scm
index ec80467..a5bb68e 100644
--- a/examples/whoisd.scm
+++ b/examples/whoisd.scm
@@ -1,21 +1,20 @@
1#! /usr/local/bin/guile -s 1#! /usr/local/bin/guile -s
2!# 2!#
3;;;; This is Scheme whoisd daemon 3;;;; This is Scheme whoisd daemon
4;;;; Copyright (C) 2002, Sergey Poznyakoff 4;;;; Copyright (C) 2002, 2007, Sergey Poznyakoff
5;;;; 5;;;;
6;;;; This program is free software; you can redistribute it and/or modify 6;;;; This program is free software; you can redistribute it and/or modify it
7;;;; it under the terms of the GNU General Public License as published by 7;;;; under the terms of the GNU General Public License as published by the
8;;;; the Free Software Foundation; either version 2 of the License, or 8;;;; Free Software Foundation; either version 3 of the License, or (at your
9;;;; (at your option) any later version. 9;;;; option) any later version.
10;;;; 10;;;;
11;;;; This program is distributed in the hope that it will be useful, 11;;;; This program is distributed in the hope that it will be useful,
12;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;;; GNU General Public License for more details. 14;;;; GNU General Public License for more details.
15;;;; 15;;;;
16;;;; You should have received a copy of the GNU General Public License 16;;;; You should have received a copy of the GNU General Public License along
17;;;; along with this program; if not, write to the Free Software Foundation, 17;;;; with this program. If not, see <http://www.gnu.org/licenses/>.
18;;;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19;;;; 18;;;;
20 19
21(set! %load-path (append %load-path (list "/usr/local/share/guile-sql"))) 20(set! %load-path (append %load-path (list "/usr/local/share/guile-sql")))
diff --git a/m4/guile.m4 b/m4/guile.m4
index 731917b..33fcbff 100644
--- a/m4/guile.m4
+++ b/m4/guile.m4
@@ -1,19 +1,18 @@
1dnl This file is part of GNU mailutils. 1dnl This file is part of GNU mailutils.
2dnl Copyright (C) 2001,2004 Free Software Foundation, Inc. 2dnl Copyright (C) 2001, 2004, 2007 Free Software Foundation, Inc.
3dnl 3dnl
4dnl This program is free software; you can redistribute it and/or modify 4dnl This program is free software; you can redistribute it and/or modify it
5dnl it under the terms of the GNU General Public License as published by 5dnl under the terms of the GNU General Public License as published by the
6dnl the Free Software Foundation; either version 2 of the License, or 6dnl Free Software Foundation; either version 3 of the License, or (at your
7dnl (at your option) any later version. 7dnl option) any later version.
8dnl 8dnl
9dnl This program is distributed in the hope that it will be useful, 9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12dnl GNU General Public License for more details. 12dnl GNU General Public License for more details.
13dnl 13dnl
14dnl You should have received a copy of the GNU General Public License 14dnl You should have received a copy of the GNU General Public License along
15dnl along with this program; if not, write to the Free Software Foundation, 15dnl with this program. If not, see <http://www.gnu.org/licenses/>.
16dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17dnl 16dnl
18 17
19dnl MU_RESULT_ACTIONS -- generate shell code for the result of a test 18dnl MU_RESULT_ACTIONS -- generate shell code for the result of a test
@@ -49,7 +48,7 @@ AC_DEFUN([MU_CHECK_GUILE],
49 GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed -n 's/guile-config - Guile version \([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\2/p'` 48 GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed -n 's/guile-config - Guile version \([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\2/p'`
50 case "x$GUILE_VERSION" in 49 case "x$GUILE_VERSION" in
51 x[[0-9]]*) 50 x[[0-9]]*)
52 if test $GUILE_VERSION -lt 16; then 51 if test $GUILE_VERSION -lt 18; then
53 AC_MSG_RESULT(Nope. Version number too low.) 52 AC_MSG_RESULT(Nope. Version number too low.)
54 mu_cv_lib_guile=no 53 mu_cv_lib_guile=no
55 else 54 else
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index cb9d99c..88811c1 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,5 +1,5 @@
1# This file is part of guile-sql. 1# This file is part of guile-sql.
2# Copyright (C) 2002, Sergey Poznyakoff 2# Copyright (C) 2002, 2007, Sergey Poznyakoff
3# 3#
4# This file is free software; as a special exception the author gives 4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without 5# unlimited permission to copy and/or distribute it, with or without
diff --git a/scripts/guile-doc-snarf.awk b/scripts/guile-doc-snarf.awk
index d31043c..03c791f 100644
--- a/scripts/guile-doc-snarf.awk
+++ b/scripts/guile-doc-snarf.awk
@@ -2,20 +2,18 @@
2# 2#
3# This is a snarfer for guile version 1.6 3# This is a snarfer for guile version 1.6
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify it
6# it under the terms of the GNU General Public License as published by 6# under the terms of the GNU General Public License as published by the
7# the Free Software Foundation; either version 2 of the License, or 7# Free Software Foundation; either version 3 of the License, or (at your
8# (at your option) any later version. 8# option) any later version.
9# 9#
10# This program is distributed in the hope that it will be useful, 10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of 11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details. 13# GNU General Public License for more details.
14# 14#
15# You should have received a copy of the GNU General Public License 15# You should have received a copy of the GNU General Public License along
16# along with this program; if not, write to the Free Software 16# with this program. If not, see <http://www.gnu.org/licenses/>.
17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18# 02110-1301 USA.
19 17
20BEGIN { 18BEGIN {
21 cname = "" 19 cname = ""
diff --git a/src/.cvsignore b/src/.cvsignore
index cff4dcc..822742d 100644
--- a/src/.cvsignore
+++ b/src/.cvsignore
@@ -10,6 +10,3 @@ guile-procedures.txt
10gsql_conn.inc 10gsql_conn.inc
11gsql_lib.inc 11gsql_lib.inc
12sql.scm 12sql.scm
13gettext.inc
14gettext.scm
15
diff --git a/src/Makefile.am b/src/Makefile.am
index 8b44d37..c5d713b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
1# This file is part of guile-sql. 1# This file is part of guile-sql.
2# Copyright (C) 2002, Sergey Poznyakoff 2# Copyright (C) 2002, 2007, Sergey Poznyakoff
3# 3#
4# This file is free software; as a special exception the author gives 4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without 5# unlimited permission to copy and/or distribute it, with or without
@@ -12,9 +12,8 @@
12INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@ 12INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@
13 13
14LIB_SQL=libguile-sql.la 14LIB_SQL=libguile-sql.la
15LIB_GETTEXT=libguile-gettext.la
16 15
17EXTRA_LTLIBRARIES=libguile-sql.la libguile-gettext.la 16EXTRA_LTLIBRARIES=libguile-sql.la
18 17
19lib_LTLIBRARIES=@BUILD_LIBS@ 18lib_LTLIBRARIES=@BUILD_LIBS@
20libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@ 19libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@
@@ -24,30 +23,22 @@ libguile_sql_la_SOURCES=\
24 23
25libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0 24libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0
26 25
27libguile_gettext_la_LIBADD = @GUILE_LIBS@ @LTLIBINTL@ 26noinst_HEADERS=guile-sql.h app.h
28libguile_gettext_la_SOURCES = gettext.c 27EXTRA_DIST=sql.sci gettext.scm
29
30libguile_gettext_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0
31
32
33noinst_HEADERS=guile-sql.h app.h gettext.h
34EXTRA_DIST=sql.sci gettext.sci
35 28
36.sci.scm: 29.sci.scm:
37 m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \ 30 m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \
38 -DBUILDDIR="`pwd`" $< > $@ 31 -DBUILDDIR="`pwd`" $< > $@
39 32
40sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc) 33sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc)
41gettext.scm: Makefile $(libguile_gettext_la_SOURCES:.c=.inc)
42 34
43SCM_SQL=sql.scm 35SCM_SQL=sql.scm
44X_SQL=gsql_conn.x 36X_SQL=gsql_conn.x
45 37
46SCM_GETTEXT=gettext.scm 38SCM_GETTEXT=gettext.scm
47X_GETTEXT=gettext.x
48 39
49guiledir=$(GUILE_SITE)/$(PACKAGE) 40guiledir=$(GUILE_SITE)/$(PACKAGE)
50guile_DATA=guile-procedures.txt @BUILD_DATA@ 41guile_DATA=guile-procedures.txt @BUILD_DATA@
51DOT_X_FILES=@BUILD_X@ 42DOT_X_FILES=@BUILD_X@
52DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc) 43DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc)
53CLEANFILES=*.inc *.x *.doc 44CLEANFILES=*.inc *.x *.doc
diff --git a/src/app.h b/src/app.h
index 56100c5..6b205ee 100644
--- a/src/app.h
+++ b/src/app.h
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002 Sergey Poznyakoff 2 Copyright (C) 2002 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef USE_SQL_MYSQL 17#ifdef USE_SQL_MYSQL
19extern struct sql_iface mysql_iface; 18extern struct sql_iface mysql_iface;
diff --git a/src/gettext.scm b/src/gettext.scm
new file mode 100644
index 0000000..a60bd59
--- a/dev/null
+++ b/src/gettext.scm
@@ -0,0 +1,29 @@
1;;;; This file is part of gettext interface for guile.
2;;;; Copyright (C) 2004, 2007 Sergey Poznyakoff
3;;;;
4;;;; This program is free software; you can redistribute it and/or modify it
5;;;; under the terms of the GNU General Public License as published by the
6;;;; Free Software Foundation; either version 3 of the License, or (at your
7;;;; option) any later version.
8;;;;
9;;;; This program is distributed in the hope that it will be useful,
10;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12;;;; GNU General Public License for more details.
13;;;;
14;;;; You should have received a copy of the GNU General Public License along
15;;;; with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
18(define-module (gamma gettext))
19
20(define (_ msgid)
21 (gettext msgid))
22
23(define (N_ msgid)
24 msgid)
25
26(export _)
27(export N_)
28
29;;;; EOF
diff --git a/src/gsql_conn.c b/src/gsql_conn.c
index 3a44c18..4a78094 100644
--- a/src/gsql_conn.c
+++ b/src/gsql_conn.c
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002, 2005 Sergey Poznyakoff 2 Copyright (C) 2002, 2005 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
19# include <config.h> 18# include <config.h>
@@ -21,14 +20,14 @@
21#include <string.h> 20#include <string.h>
22#include <guile-sql.h> 21#include <guile-sql.h>
23#include <app.h> 22#include <app.h>
23#include <stdio.h>
24 24
25static int num_iface; 25static int num_iface;
26struct sql_iface sql_iftab[MAX_IFACES]; 26static struct sql_iface sql_iftab[MAX_IFACES];
27 27
28SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error"); 28SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error");
29 29
30 30static long sql_connect_tag = -1;
31long sql_connect_tag;
32 31
33/* SMOB functions: */ 32/* SMOB functions: */
34static SCM 33static SCM
@@ -50,7 +49,7 @@ sql_connect_free (SCM connect_smob)
50 free(conn->username); 49 free(conn->username);
51 if (conn->database) 50 if (conn->database)
52 free(conn->database); 51 free(conn->database);
53 free(conn); 52 scm_gc_free(conn, sizeof *conn, "SQL connection");
54 return size; 53 return size;
55} 54}
56 55
@@ -76,8 +75,8 @@ sql_connect_print (SCM connect_smob, SCM port, scm_print_state * pstate)
76 return 1; 75 return 1;
77} 76}
78 77
79int 78static int
80sql_find_iface(char *name) 79sql_find_iface(const char *name)
81 { 80 {
82 int iface; 81 int iface;
83 82
@@ -95,15 +94,15 @@ sql_connect_create (char *name)
95 if (iface < 0) 94 if (iface < 0)
96 scm_misc_error("sql_connect_create", 95 scm_misc_error("sql_connect_create",
97 "Unknown SQL interface ~S", 96 "Unknown SQL interface ~S",
98 SCM_LIST1(scm_makfrom0str(name))); 97 scm_list_1(scm_makfrom0str(name)));
99 98
100 conn = scm_must_malloc (sizeof (*conn), "sql_connect"); 99 conn = scm_gc_malloc (sizeof (*conn), "sql_connect");
101 memset(conn, 0, sizeof *conn); 100 memset(conn, 0, sizeof *conn);
102 conn->iface = iface; 101 conn->iface = iface;
103 SCM_RETURN_NEWSMOB (sql_connect_tag, conn); 102 SCM_RETURN_NEWSMOB (sql_connect_tag, conn);
104} 103}
105 104
106int 105static int
107scm_is_sql_connect (SCM scm) 106scm_is_sql_connect (SCM scm)
108{ 107{
109 return SCM_NIMP (scm) && SCM_CAR (scm) == (SCM) sql_connect_tag; 108 return SCM_NIMP (scm) && SCM_CAR (scm) == (SCM) sql_connect_tag;
@@ -117,18 +116,18 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0,
117#define FUNC_NAME s_sql_connect 116#define FUNC_NAME s_sql_connect
118{ 117{
119 SCM smob; 118 SCM smob;
120 char *hostname; 119 const char *hostname;
121 int port; 120 int port;
122 char *dbname; 121 const char *dbname;
123 char *user; 122 const char *user;
124 char *pass; 123 const char *pass;
125 int iface; 124 int iface;
126 struct sql_connect *conn; 125 struct sql_connect *conn;
127 126
128 if (SCM_IMP(IFACE) && SCM_INUMP(IFACE)) 127 if (scm_is_integer(IFACE))
129 iface = SCM_INUM(IFACE); 128 iface = scm_to_int(IFACE);
130 else if (SCM_STRINGP(IFACE)) 129 else if (scm_is_string(IFACE))
131 iface = sql_find_iface(SCM_CHARS(IFACE)); 130 iface = sql_find_iface(scm_i_string_chars(IFACE));
132 else { 131 else {
133 SCM_ASSERT(IFACE == SCM_BOOL_T || IFACE == SCM_BOOL_F, 132 SCM_ASSERT(IFACE == SCM_BOOL_T || IFACE == SCM_BOOL_F,
134 IFACE, SCM_ARG1, FUNC_NAME); 133 IFACE, SCM_ARG1, FUNC_NAME);
@@ -137,26 +136,25 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0,
137 if (iface < 0 || iface >= num_iface) 136 if (iface < 0 || iface >= num_iface)
138 scm_misc_error(FUNC_NAME, 137 scm_misc_error(FUNC_NAME,
139 "Argument ~S (~S) out of range", 138 "Argument ~S (~S) out of range",
140 SCM_LIST2(SCM_MAKINUM(1), 139 scm_list_2(scm_from_int(1),
141 IFACE)); 140 IFACE));
142 141
143 SCM_ASSERT(SCM_STRINGP(HOST), HOST, SCM_ARG1, FUNC_NAME); 142 SCM_ASSERT(scm_is_string(HOST), HOST, SCM_ARG1, FUNC_NAME);
144 hostname = SCM_ROCHARS(HOST); 143 hostname = scm_i_string_chars(HOST);
145 144
146 SCM_ASSERT(SCM_IMP(PORT) && SCM_INUMP(PORT), 145 SCM_ASSERT(scm_is_number(PORT), PORT, SCM_ARG2, FUNC_NAME);
147 PORT, SCM_ARG2, FUNC_NAME); 146 port = scm_to_int(PORT);
148 port = SCM_INUM(PORT);
149 147
150 SCM_ASSERT(SCM_STRINGP(DB), DB, SCM_ARG3, FUNC_NAME); 148 SCM_ASSERT(scm_is_string(DB), DB, SCM_ARG3, FUNC_NAME);
151 dbname = SCM_ROCHARS(DB); 149 dbname = scm_i_string_chars(DB);
152 150
153 SCM_ASSERT(SCM_STRINGP(USER), USER, SCM_ARG4, FUNC_NAME); 151 SCM_ASSERT(scm_is_string(USER), USER, SCM_ARG4, FUNC_NAME);
154 user = SCM_ROCHARS(USER); 152 user = scm_i_string_chars(USER);
155 153
156 if (SCM_UNBNDP(PASS)) 154 if (SCM_UNBNDP(PASS))
157 pass = NULL; 155 pass = NULL;
158 else if (SCM_STRINGP(USER)) 156 else if (scm_is_string(USER))
159 pass = SCM_ROCHARS(PASS); 157 pass = scm_i_string_chars(PASS);
160 158
161 smob = sql_iftab[iface].connect(hostname, port, 159 smob = sql_iftab[iface].connect(hostname, port,
162 dbname, user, pass, 160 dbname, user, pass,
@@ -192,12 +190,12 @@ SCM_DEFINE (sql_query, "sql-query", 2, 0, 0,
192{ 190{
193 struct sql_connect *conn; 191 struct sql_connect *conn;
194 void *ptr; 192 void *ptr;
195 char *query; 193 const char *query;
196 194
197 SCM_ASSERT(scm_is_sql_connect(CONN), CONN, SCM_ARG1, FUNC_NAME); 195 SCM_ASSERT(scm_is_sql_connect(CONN), CONN, SCM_ARG1, FUNC_NAME);
198 SCM_ASSERT(SCM_STRINGP(QUERY), QUERY, SCM_ARG2, FUNC_NAME); 196 SCM_ASSERT(scm_is_string(QUERY), QUERY, SCM_ARG2, FUNC_NAME);
199 conn = (struct sql_connect *)SCM_CDR(CONN); 197 conn = (struct sql_connect *)SCM_CDR(CONN);
200 query = SCM_ROCHARS(QUERY); 198 query = scm_i_string_chars(QUERY);
201 return sql_iftab[conn->iface].query(conn, query); 199 return sql_iftab[conn->iface].query(conn, query);
202} 200}
203#undef FUNC_NAME 201#undef FUNC_NAME
@@ -220,11 +218,13 @@ sql_register_iface(struct sql_iface *ifp)
220void 218void
221gsql_conn_init() 219gsql_conn_init()
222{ 220{
223 sql_connect_tag = scm_make_smob_type ("sql_connect", 221 if (sql_connect_tag == -1) {
222 sql_connect_tag = scm_make_smob_type ("sql_connect",
224 sizeof (struct sql_connect)); 223 sizeof (struct sql_connect));
225 scm_set_smob_mark (sql_connect_tag, sql_connect_mark); 224 scm_set_smob_mark (sql_connect_tag, sql_connect_mark);
226 scm_set_smob_free (sql_connect_tag, sql_connect_free); 225 scm_set_smob_free (sql_connect_tag, sql_connect_free);
227 scm_set_smob_print (sql_connect_tag, sql_connect_print); 226 scm_set_smob_print (sql_connect_tag, sql_connect_print);
227 }
228#ifndef SCM_MAGIC_SNARFER 228#ifndef SCM_MAGIC_SNARFER
229# include <gsql_conn.x> 229# include <gsql_conn.x>
230#endif 230#endif
diff --git a/src/gsql_lib.c b/src/gsql_lib.c
index c988b2e..a6103b2 100644
--- a/src/gsql_lib.c
+++ b/src/gsql_lib.c
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002 Sergey Poznyakoff 2 Copyright (C) 2002 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
19# include <config.h> 18# include <config.h>
@@ -26,7 +25,7 @@ scm_makenum (unsigned long val)
26#ifndef HAVE_SCM_LONG2NUM 25#ifndef HAVE_SCM_LONG2NUM
27{ 26{
28 if (SCM_FIXABLE ((long) val)) 27 if (SCM_FIXABLE ((long) val))
29 return SCM_MAKINUM (val); 28 return scm_from_int (val);
30 29
31#ifdef SCM_BIGDIG 30#ifdef SCM_BIGDIG
32 return scm_i_long2big (val); 31 return scm_i_long2big (val);
@@ -40,20 +39,6 @@ scm_makenum (unsigned long val)
40} 39}
41#endif 40#endif
42 41
43/*
44 * Chop off trailing whitespace. Return length of the resulting string
45 */
46int
47chop(char *str)
48{
49 int len;
50
51 for (len = strlen(str); len > 0 && isspace(str[len-1]); len--)
52 ;
53 str[len] = 0;
54 return len;
55}
56
57extern void 42extern void
58sql_init() 43sql_init()
59{ 44{
diff --git a/src/guile-sql.h b/src/guile-sql.h
index 5203123..154b322 100644
--- a/src/guile-sql.h
+++ b/src/guile-sql.h
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002 Sergey Poznyakoff 2 Copyright (C) 2002, 2007 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#include <sys/socket.h> 17#include <sys/socket.h>
19#include <netinet/in.h> 18#include <netinet/in.h>
@@ -41,10 +40,11 @@ struct sql_iface {
41 char *name; 40 char *name;
42 SCM (*mark) (struct sql_connect *); 41 SCM (*mark) (struct sql_connect *);
43 scm_sizet (*free) (struct sql_connect *); 42 scm_sizet (*free) (struct sql_connect *);
44 SCM (*connect) (char *hostname, int port, 43 SCM (*connect) (const char *hostname, int port,
45 char *dbname, char *user, char *pass, const char *why); 44 const char *dbname, const char *user,
45 const char *pass, const char *why);
46 void (*close) (struct sql_connect *); 46 void (*close) (struct sql_connect *);
47 SCM (*query) (struct sql_connect *, char *query); 47 SCM (*query) (struct sql_connect *, const char *query);
48}; 48};
49 49
50extern struct sql_iface sql_iftab[]; 50extern struct sql_iface sql_iftab[];
diff --git a/src/mysql.c b/src/mysql.c
index d788a92..ac7e0f7 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002,2004,2005 Sergey Poznyakoff 2 Copyright (C) 2002, 2004, 2005 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
19# include <config.h> 18# include <config.h>
@@ -22,13 +21,13 @@
22#include <guile-sql.h> 21#include <guile-sql.h>
23#include <mysql/mysql.h> 22#include <mysql/mysql.h>
24 23
25SCM 24static SCM
26s_mysql_mark(struct sql_connect *conn) 25s_mysql_mark(struct sql_connect *conn)
27{ 26{
28 return SCM_BOOL_F; 27 return SCM_BOOL_F;
29} 28}
30 29
31scm_sizet 30static scm_sizet
32s_mysql_free(struct sql_connect *conn) 31s_mysql_free(struct sql_connect *conn)
33{ 32{
34 MYSQL *mysql = (MYSQL*) conn->data; 33 MYSQL *mysql = (MYSQL*) conn->data;
@@ -38,14 +37,15 @@ s_mysql_free(struct sql_connect *conn)
38 return sizeof(MYSQL); 37 return sizeof(MYSQL);
39} 38}
40 39
41SCM 40static SCM
42s_mysql_connect (char *hostname, int port, 41s_mysql_connect (const char *hostname, int port,
43 char *dbname, char *user, char *pass, const char *why) 42 const char *dbname, const char *user, const char *pass,
43 const char *why)
44{ 44{
45 MYSQL *mysql; 45 MYSQL *mysql;
46 SCM smob; 46 SCM smob;
47 struct sql_connect *conn; 47 struct sql_connect *conn;
48 char *socket_path = NULL; 48 const char *socket_path = NULL;
49 49
50 mysql = mysql_init(NULL); 50 mysql = mysql_init(NULL);
51 if (!mysql) 51 if (!mysql)
@@ -72,8 +72,8 @@ s_mysql_connect (char *hostname, int port,
72 return smob; 72 return smob;
73} 73}
74 74
75SCM 75static SCM
76s_mysql_query(struct sql_connect *conn, char *query) 76s_mysql_query(struct sql_connect *conn, const char *query)
77{ 77{
78 MYSQL *mysql = conn->data; 78 MYSQL *mysql = conn->data;
79 MYSQL_RES *result; 79 MYSQL_RES *result;
@@ -99,9 +99,8 @@ s_mysql_query(struct sql_connect *conn, char *query)
99 if (!row) 99 if (!row)
100 break; 100 break;
101 for (j = 0; j < nfields; j++) { 101 for (j = 0; j < nfields; j++) {
102 SCM new_elt; 102 SCM new_elt = scm_cons(scm_makfrom0str(row[j]),
103 SCM_NEWCELL(new_elt); 103 SCM_EOL);
104 SCM_SETCAR(new_elt, scm_makfrom0str(row[j]));
105 if (head == SCM_EOL) 104 if (head == SCM_EOL)
106 head = new_elt; 105 head = new_elt;
107 else 106 else
@@ -109,20 +108,13 @@ s_mysql_query(struct sql_connect *conn, char *query)
109 tail = new_elt; 108 tail = new_elt;
110 } 109 }
111 110
112 if (head != SCM_EOL) 111 new_row = scm_cons(head, SCM_EOL);
113 SCM_SETCDR(tail, SCM_EOL);
114
115 SCM_NEWCELL(new_row);
116 SCM_SETCAR(new_row, head);
117
118 if (row_head == SCM_EOL) 112 if (row_head == SCM_EOL)
119 row_head = new_row; 113 row_head = new_row;
120 else 114 else
121 SCM_SETCDR(row_tail, new_row); 115 SCM_SETCDR(row_tail, new_row);
122 row_tail = new_row; 116 row_tail = new_row;
123 } 117 }
124 if (row_head != SCM_EOL)
125 SCM_SETCDR(row_tail, SCM_EOL);
126 cell = row_head; 118 cell = row_head;
127 mysql_free_result(result); 119 mysql_free_result(result);
128 } else { /* should it have returned something? */ 120 } else { /* should it have returned something? */
@@ -137,7 +129,7 @@ s_mysql_query(struct sql_connect *conn, char *query)
137 return cell; 129 return cell;
138} 130}
139 131
140void 132static void
141s_mysql_close(struct sql_connect *conn) 133s_mysql_close(struct sql_connect *conn)
142{ 134{
143 if (conn->data) 135 if (conn->data)
diff --git a/src/pgsql.c b/src/pgsql.c
index 44b1fa6..011a4b7 100644
--- a/src/pgsql.c
+++ b/src/pgsql.c
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002 Sergey Poznyakoff 2 Copyright (C) 2002 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
19# include <config.h> 18# include <config.h>
@@ -22,13 +21,13 @@
22#include <guile-sql.h> 21#include <guile-sql.h>
23#include <libpq-fe.h> 22#include <libpq-fe.h>
24 23
25SCM 24static SCM
26s_pgsql_mark(struct sql_connect *conn) 25s_pgsql_mark(struct sql_connect *conn)
27{ 26{
28 return SCM_BOOL_F; 27 return SCM_BOOL_F;
29} 28}
30 29
31scm_sizet 30static scm_sizet
32s_pgsql_free(struct sql_connect *conn) 31s_pgsql_free(struct sql_connect *conn)
33{ 32{
34 PGconn *pgconn = (PGconn*) conn->data; 33 PGconn *pgconn = (PGconn*) conn->data;
@@ -38,9 +37,10 @@ s_pgsql_free(struct sql_connect *conn)
38 return sizeof(pgconn); 37 return sizeof(pgconn);
39} 38}
40 39
41SCM 40static SCM
42s_pgsql_connect (char *hostname, int port, 41s_pgsql_connect (const char *hostname, int port,
43 char *dbname, char *user, char *pass, const char *why) 42 const char *dbname, const char *user, const char *pass,
43 const char *why)
44{ 44{
45 PGconn *pgconn; 45 PGconn *pgconn;
46 char buf[24]; 46 char buf[24];
@@ -62,7 +62,7 @@ s_pgsql_connect (char *hostname, int port,
62 return smob; 62 return smob;
63} 63}
64 64
65SCM 65static SCM
66result_to_list(PGresult *res) 66result_to_list(PGresult *res)
67{ 67{
68 int i, j; 68 int i, j;
@@ -75,10 +75,8 @@ result_to_list(PGresult *res)
75 SCM head = SCM_EOL, tail; 75 SCM head = SCM_EOL, tail;
76 76
77 for (j = 0; j < nfields; j++) { 77 for (j = 0; j < nfields; j++) {
78 SCM new_elt;
79 char *val = PQgetvalue(res, i, j); 78 char *val = PQgetvalue(res, i, j);
80 SCM_NEWCELL(new_elt); 79 SCM new_elt = scm_cons(scm_makfrom0str(val), SCM_EOL);
81 SCM_SETCAR(new_elt, scm_makfrom0str(val));
82 if (head == SCM_EOL) 80 if (head == SCM_EOL)
83 head = new_elt; 81 head = new_elt;
84 else 82 else
@@ -86,11 +84,7 @@ result_to_list(PGresult *res)
86 tail = new_elt; 84 tail = new_elt;
87 } 85 }
88 86
89 if (head != SCM_EOL) 87 new_row = scm_cons(head, SCM_EOL);
90 SCM_SETCDR(tail, SCM_EOL);
91
92 SCM_NEWCELL(new_row);
93 SCM_SETCAR(new_row, head);
94 88
95 if (row_head == SCM_EOL) 89 if (row_head == SCM_EOL)
96 row_head = new_row; 90 row_head = new_row;
@@ -98,13 +92,11 @@ result_to_list(PGresult *res)
98 SCM_SETCDR(row_tail, new_row); 92 SCM_SETCDR(row_tail, new_row);
99 row_tail = new_row; 93 row_tail = new_row;
100 } 94 }
101 if (row_head != SCM_EOL)
102 SCM_SETCDR(row_tail, SCM_EOL);
103 return row_head; 95 return row_head;
104} 96}
105 97
106SCM 98static SCM
107s_pgsql_query(struct sql_connect *conn, char *query) 99s_pgsql_query(struct sql_connect *conn, const char *query)
108{ 100{
109 PGconn *pgconn = (PGconn*) conn->data; 101 PGconn *pgconn = (PGconn*) conn->data;
110 PGresult *res; 102 PGresult *res;
@@ -137,7 +129,7 @@ s_pgsql_query(struct sql_connect *conn, char *query)
137 return cell; 129 return cell;
138} 130}
139 131
140void 132static void
141s_pgsql_close(struct sql_connect *conn) 133s_pgsql_close(struct sql_connect *conn)
142{ 134{
143 PGconn *pgconn = (PGconn*) conn->data; 135 PGconn *pgconn = (PGconn*) conn->data;

Return to:

Send suggestions and report system problems to the System administrator.