questgen-commits Mailing List for questgen
Status: Planning
Brought to you by:
rfboehme
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(2) |
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
From: <rfb...@us...> - 2008-11-09 15:29:06
|
Revision: 17 http://questgen.svn.sourceforge.net/questgen/?rev=17&view=rev Author: rfboehme Date: 2008-11-09 15:29:03 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Moved more lua stuff. Added Paths: ----------- trunk/old/lua/luawithpath.sh trunk/old/lua/runalltests.lua trunk/old/lua/test/ trunk/old/lua/test/questgen/ trunk/old/lua/test/questgen/CharacterGoalTest.lua Added: trunk/old/lua/luawithpath.sh =================================================================== --- trunk/old/lua/luawithpath.sh (rev 0) +++ trunk/old/lua/luawithpath.sh 2008-11-09 15:29:03 UTC (rev 17) @@ -0,0 +1,12 @@ +#!/bin/bash + +LUA_PATH="$LUA_PATH;./src/?.lua;./test/?.lua" +LUA_PATH="$LUA_PATH;./lib/luaunit_v13/?.lua;./lib/luasql-2.1.1/?.lua" + +export LUA_PATH + +#echo Lua $0 with path $LUA_PATH + +/usr/bin/lua $1 + +exit 0 Property changes on: trunk/old/lua/luawithpath.sh ___________________________________________________________________ Added: svn:executable + * Added: trunk/old/lua/runalltests.lua =================================================================== --- trunk/old/lua/runalltests.lua (rev 0) +++ trunk/old/lua/runalltests.lua 2008-11-09 15:29:03 UTC (rev 17) @@ -0,0 +1,2 @@ +require('questgen.CharacterGoalTest') + Added: trunk/old/lua/test/questgen/CharacterGoalTest.lua =================================================================== --- trunk/old/lua/test/questgen/CharacterGoalTest.lua (rev 0) +++ trunk/old/lua/test/questgen/CharacterGoalTest.lua 2008-11-09 15:29:03 UTC (rev 17) @@ -0,0 +1,22 @@ +require('luaunit') +require('questgen.CharacterGoal') + +CharacterGoalTest = { charGoal } + +function CharacterGoalTest:setUp() + print('CharacterGoalTest setUp') + + charGoal = QuestgenCharacterGoal:new() +end + +function CharacterGoalTest:tearDown() + print('CharacterGoalTest tearDown') +end + +function CharacterGoalTest:test_success() + assertEquals(charGoal:retTwo(),2) +end + +-- TestFunctions = wrapFunctions( 'test_success' ) + +LuaUnit:run('CharacterGoalTest') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-11-09 15:27:01
|
Revision: 16 http://questgen.svn.sourceforge.net/questgen/?rev=16&view=rev Author: rfboehme Date: 2008-11-09 15:26:59 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Moved lua stuff to old directory Added Paths: ----------- trunk/old/ trunk/old/lua/ trunk/old/lua/lualib/ trunk/old/lua/luasrc/ Removed Paths: ------------- trunk/lualib/ trunk/luasrc/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-11-09 15:23:43
|
Revision: 15 http://questgen.svn.sourceforge.net/questgen/?rev=15&view=rev Author: rfboehme Date: 2008-11-09 15:23:32 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Added new src directory Added Paths: ----------- trunk/src/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-11-09 15:21:27
|
Revision: 14 http://questgen.svn.sourceforge.net/questgen/?rev=14&view=rev Author: rfboehme Date: 2008-11-09 15:21:17 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Moved lua lib and src to different directories. Modified Paths: -------------- trunk/luasrc/questgen/CharacterGoal.lua trunk/luasrc/questgen/CharacterProblem.lua trunk/luasrc/questgen/Quest.lua trunk/luasrc/questgen/QuestGoal.lua trunk/luasrc/questgen/Scene.lua trunk/luasrc/questgen/Story.lua trunk/luasrc/questgen/StoryCharacter.lua Added Paths: ----------- trunk/lualib/ trunk/lualib/luasql-2.1.1/ trunk/lualib/luaunit_v13/ trunk/luasrc/ Removed Paths: ------------- trunk/lib/ trunk/src/ Property changes on: trunk/lualib ___________________________________________________________________ Added: svn:mergeinfo + Property changes on: trunk/luasrc ___________________________________________________________________ Added: svn:mergeinfo + Modified: trunk/luasrc/questgen/CharacterGoal.lua =================================================================== --- trunk/src/questgen/CharacterGoal.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/CharacterGoal.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -4,7 +4,19 @@ --]] -module(..., package.seeall) +QuestgenCharacterGoal = {} +local goalType; +local goalTarget; +function QuestgenCharacterGoal:new(o) + o = o or {} + setmetatable(o, self) + self.__index = self + return o +end +function QuestgenCharacterGoal:retTwo() + return retTwoNum; +end + Modified: trunk/luasrc/questgen/CharacterProblem.lua =================================================================== --- trunk/src/questgen/CharacterProblem.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/CharacterProblem.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/luasrc/questgen/Quest.lua =================================================================== --- trunk/src/questgen/Quest.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/Quest.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/luasrc/questgen/QuestGoal.lua =================================================================== --- trunk/src/questgen/QuestGoal.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/QuestGoal.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/luasrc/questgen/Scene.lua =================================================================== --- trunk/src/questgen/Scene.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/Scene.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/luasrc/questgen/Story.lua =================================================================== --- trunk/src/questgen/Story.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/Story.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -3,7 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - Modified: trunk/luasrc/questgen/StoryCharacter.lua =================================================================== --- trunk/src/questgen/StoryCharacter.lua 2007-12-17 16:32:55 UTC (rev 6) +++ trunk/luasrc/questgen/StoryCharacter.lua 2008-11-09 15:21:17 UTC (rev 14) @@ -4,6 +4,19 @@ --]] -module(..., package.seeall) +QuestgenStoryCharacter = {} +local status; +local location; +local goalList; +function QuestgenStoryCharacter:new(o) + o = o or {} + setmetatable(o, self) + self.__index = self + return o +end + +function QuestgenStoryCharacter:retTwo() + return retTwoNum; +end \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-03-17 11:51:16
|
Revision: 13 http://questgen.svn.sourceforge.net/questgen/?rev=13&view=rev Author: rfboehme Date: 2008-03-17 04:51:13 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Test 1 - need to compile properly Added Paths: ----------- trunk/proofOfConcept/richard/001/StoryChar.lua trunk/proofOfConcept/richard/001/dataTables.lua trunk/proofOfConcept/richard/001/generateQuest.lua Added: trunk/proofOfConcept/richard/001/StoryChar.lua =================================================================== --- trunk/proofOfConcept/richard/001/StoryChar.lua (rev 0) +++ trunk/proofOfConcept/richard/001/StoryChar.lua 2008-03-17 11:51:13 UTC (rev 13) @@ -0,0 +1,16 @@ +StoryChar = {} + +local location; +local goal; +local relationshipList; +local gender; +local purpose; +local job; + +function QuestgenStoryCharacter:new(o) + o = o or {} + setmetatable(o, self) + self.__index = self + return o +end + Added: trunk/proofOfConcept/richard/001/dataTables.lua =================================================================== --- trunk/proofOfConcept/richard/001/dataTables.lua (rev 0) +++ trunk/proofOfConcept/richard/001/dataTables.lua 2008-03-17 11:51:13 UTC (rev 13) @@ -0,0 +1,9 @@ +locationList = { 'office', 'kitchen', 'soup factory' } + +jobList = { 'lawyer', 'carpenter', 'programmer' } + +problemList = {} +problemList['lawyer']={'get document', 'call person', 'dictate message'} +problemList['carpenter']={'get nails', 'give nails to person', 'hammer wood'} +problemList['programmer']={'write spec', 'write code', 'get chocolate'} + Added: trunk/proofOfConcept/richard/001/generateQuest.lua =================================================================== --- trunk/proofOfConcept/richard/001/generateQuest.lua (rev 0) +++ trunk/proofOfConcept/richard/001/generateQuest.lua 2008-03-17 11:51:13 UTC (rev 13) @@ -0,0 +1,22 @@ +-- This generates a quest by creating char. etc according to the spec + +loadfile('dataTables.lua') + +local char1 = generateCharacter +-- print char1.location + + +function generateStory() +end + +function generateCharacter() + local char = StoryChar:new() + char.location=math.random(table.getn(locationList)) + char.goal=nil + char.relationshipList=nil + char.gender='F' + char.purpose=math.random(table.getn(purposeList)) + char.job=math.random(table.getn(jobList)) + + return char; +end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kal...@us...> - 2008-03-17 08:29:33
|
Revision: 12 http://questgen.svn.sourceforge.net/questgen/?rev=12&view=rev Author: kalevtait Date: 2008-03-17 01:29:27 -0700 (Mon, 17 Mar 2008) Log Message: ----------- Added Paths: ----------- trunk/proofOfConcept/kalev/ trunk/proofOfConcept/kalev/001/ trunk/proofOfConcept/kalev/001/QuestGen Prototype.txt Added: trunk/proofOfConcept/kalev/001/QuestGen Prototype.txt =================================================================== --- trunk/proofOfConcept/kalev/001/QuestGen Prototype.txt (rev 0) +++ trunk/proofOfConcept/kalev/001/QuestGen Prototype.txt 2008-03-17 08:29:27 UTC (rev 12) @@ -0,0 +1,69 @@ +----------------------------------- +plan_templates = {} + +function plan_templates:AddPlanTemplate(name) + new_plan = {} + new_plan.Name = name + new_plan.Results = {} + new_plan.Requirements = {} + function new_plan:CreateInstance() + plan_instance = {} + plan_instance.Template = self + plan_instance.Children = {} + return plan_instance + end + self[#self + 1] = new_plan + return new_plan +end + +winter_food = plan_templates:AddPlanTemplate("Have food for winter") +winter_food.Results[1] = "Safety" +winter_food.Requirements[1] = "Have food" + +----------------------------------- +characters = {} + +function characters:AddCharacter(name) + new_char = {} + new_char.Name = name + new_char.Desire = "Safety" + function new_char:MakePlan() + print(self.Name .. " is planing:") + for i1, plan_template in ipairs(plan_templates) do + for i2, plan_result in ipairs(plan_template.Results) do + if (plan_result == self.Desire) then + self.Plan = plan_template:CreateInstance() + return + end + end + end + end + self[#self + 1] = new_char +end + +function characters:MakePlans() + for index, character in ipairs(self) do + character:MakePlan() + end +end + +function characters:List() + for index, character in ipairs(self) do + print(character.Name .. ":") + print("- Wants " .. character.Desire) + print("- Plans:") + if character.Plan == nil then + print(" - None") + else + print(" - " .. character.Plan.Template.Name) + end + end +end + +----------------------------------- +do + characters:AddCharacter("Andrew") + --characters:AddCharacter("Bob") + characters:MakePlans() + characters:List() +end \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-03-04 22:14:51
|
Revision: 11 http://questgen.svn.sourceforge.net/questgen/?rev=11&view=rev Author: rfboehme Date: 2008-03-04 14:14:48 -0800 (Tue, 04 Mar 2008) Log Message: ----------- added 001 dir Added Paths: ----------- trunk/proofOfConcept/richard/001/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-03-04 22:13:00
|
Revision: 10 http://questgen.svn.sourceforge.net/questgen/?rev=10&view=rev Author: rfboehme Date: 2008-03-04 14:12:56 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Added proofOfConcept directory; slightly changed work spec. Modified Paths: -------------- trunk/docs/Quest Generator - Inital Work Spec.txt trunk/src/questgen/StoryCharacter.lua Added Paths: ----------- trunk/proofOfConcept/ trunk/proofOfConcept/richard/ Modified: trunk/docs/Quest Generator - Inital Work Spec.txt =================================================================== --- trunk/docs/Quest Generator - Inital Work Spec.txt 2008-02-19 13:52:11 UTC (rev 9) +++ trunk/docs/Quest Generator - Inital Work Spec.txt 2008-03-04 22:12:56 UTC (rev 10) @@ -59,6 +59,8 @@ Quest Goal Quest Fallback Goal + + IsPublic - is this quest available on a 'quest board' if there is a provision for one. QuestGoal Modified: trunk/src/questgen/StoryCharacter.lua =================================================================== --- trunk/src/questgen/StoryCharacter.lua 2008-02-19 13:52:11 UTC (rev 9) +++ trunk/src/questgen/StoryCharacter.lua 2008-03-04 22:12:56 UTC (rev 10) @@ -14,7 +14,7 @@ local currentLocation; local gender; local purpose; -local jobType; +local jobList; function QuestgenStoryCharacter:new(o) o = o or {} @@ -27,5 +27,7 @@ end function QuestgenStoryCharacter:addRelationship(relationship) - return retTwoNum; -end \ No newline at end of file +end + +function QuestgenStoryCharacter:addJob(job) +end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-02-19 13:52:35
|
Revision: 9 http://questgen.svn.sourceforge.net/questgen/?rev=9&view=rev Author: rfboehme Date: 2008-02-19 05:52:11 -0800 (Tue, 19 Feb 2008) Log Message: ----------- Added a couple of stub methods, changed doc some. Modified Paths: -------------- trunk/docs/Quest Generator - Inital Work Spec.txt trunk/src/questgen/CharacterGoal.lua trunk/src/questgen/CharacterProblem.lua trunk/src/questgen/Quest.lua trunk/src/questgen/QuestGoal.lua trunk/src/questgen/Scene.lua trunk/src/questgen/Story.lua trunk/src/questgen/StoryCharacter.lua Modified: trunk/docs/Quest Generator - Inital Work Spec.txt =================================================================== --- trunk/docs/Quest Generator - Inital Work Spec.txt 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/docs/Quest Generator - Inital Work Spec.txt 2008-02-19 13:52:11 UTC (rev 9) @@ -83,23 +83,26 @@ -To create a quest: +To create a story: 1. Create a character or pick one from the world. -2. Create a purpose / problem for the character. +2. Create a set of purposes / problems for the character. -3. Create a quest for the character. +3. Create a end goal for the character -4. The quest creates a 'start' scene: +4. Create or pick objects and characters to get to the end goal. -5. The quest does not create -6. The quest creates an 'end' scene, where the character has the problem resolved. +- The quest creates a 'start' scene: +- The quest does not create intermediate scenes yet. +- The quest creates an 'end' scene, where the character has the problem resolved. + + To create a character: 1. Pick a location for the character. (or location is provided). Modified: trunk/src/questgen/CharacterGoal.lua =================================================================== --- trunk/src/questgen/CharacterGoal.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/CharacterGoal.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -4,7 +4,19 @@ --]] -module(..., package.seeall) +QuestgenCharacterGoal = {} +local goalType; +local goalTarget; +function QuestgenCharacterGoal:new(o) + o = o or {} + setmetatable(o, self) + self.__index = self + return o +end +function QuestgenCharacterGoal:retTwo() + return retTwoNum; +end + Modified: trunk/src/questgen/CharacterProblem.lua =================================================================== --- trunk/src/questgen/CharacterProblem.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/CharacterProblem.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/src/questgen/Quest.lua =================================================================== --- trunk/src/questgen/Quest.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/Quest.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/src/questgen/QuestGoal.lua =================================================================== --- trunk/src/questgen/QuestGoal.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/QuestGoal.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/src/questgen/Scene.lua =================================================================== --- trunk/src/questgen/Scene.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/Scene.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -3,8 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - - Modified: trunk/src/questgen/Story.lua =================================================================== --- trunk/src/questgen/Story.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/Story.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -3,7 +3,3 @@ This is a module for a story. --]] - -module(..., package.seeall) - - Modified: trunk/src/questgen/StoryCharacter.lua =================================================================== --- trunk/src/questgen/StoryCharacter.lua 2008-01-16 02:40:45 UTC (rev 8) +++ trunk/src/questgen/StoryCharacter.lua 2008-02-19 13:52:11 UTC (rev 9) @@ -4,6 +4,28 @@ --]] -module(..., package.seeall) +QuestgenStoryCharacter = {} +local status; +local location; +local goalList; +local relationshipList; +local homeLocation; +local currentLocation; +local gender; +local purpose; +local jobType; +function QuestgenStoryCharacter:new(o) + o = o or {} + setmetatable(o, self) + self.__index = self + return o +end + +function QuestgenStoryCharacter:addGoal(goal) +end + +function QuestgenStoryCharacter:addRelationship(relationship) + return retTwoNum; +end \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2008-01-16 02:40:47
|
Revision: 8 http://questgen.svn.sourceforge.net/questgen/?rev=8&view=rev Author: rfboehme Date: 2008-01-15 18:40:45 -0800 (Tue, 15 Jan 2008) Log Message: ----------- added luaunit and luasql lua modules. Added Paths: ----------- trunk/lib/luasql-2.1.1/ trunk/lib/luasql-2.1.1/Makefile trunk/lib/luasql-2.1.1/Makefile.win.ado trunk/lib/luasql-2.1.1/Makefile.win.mysql trunk/lib/luasql-2.1.1/Makefile.win.odbc trunk/lib/luasql-2.1.1/Makefile.win.sqlite3 trunk/lib/luasql-2.1.1/README trunk/lib/luasql-2.1.1/config trunk/lib/luasql-2.1.1/doc/ trunk/lib/luasql-2.1.1/doc/br/ trunk/lib/luasql-2.1.1/doc/br/examples.html trunk/lib/luasql-2.1.1/doc/br/history.html trunk/lib/luasql-2.1.1/doc/br/index.html trunk/lib/luasql-2.1.1/doc/br/license.html trunk/lib/luasql-2.1.1/doc/br/luasql.png trunk/lib/luasql-2.1.1/doc/br/manual.html trunk/lib/luasql-2.1.1/doc/us/ trunk/lib/luasql-2.1.1/doc/us/examples.html trunk/lib/luasql-2.1.1/doc/us/history.html trunk/lib/luasql-2.1.1/doc/us/index.html trunk/lib/luasql-2.1.1/doc/us/license.html trunk/lib/luasql-2.1.1/doc/us/luasql.png trunk/lib/luasql-2.1.1/doc/us/manual.html trunk/lib/luasql-2.1.1/src/ trunk/lib/luasql-2.1.1/src/ado/ trunk/lib/luasql-2.1.1/src/ado/ado.lua trunk/lib/luasql-2.1.1/src/jdbc/ trunk/lib/luasql-2.1.1/src/jdbc/Makefile trunk/lib/luasql-2.1.1/src/jdbc/Makefile.win trunk/lib/luasql-2.1.1/src/jdbc/build.xml trunk/lib/luasql-2.1.1/src/jdbc/src/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/org/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/org/keplerproject/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/org/keplerproject/luasql/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/org/keplerproject/luasql/jdbc/ trunk/lib/luasql-2.1.1/src/jdbc/src/java/org/keplerproject/luasql/jdbc/LuaSQLCursor.java trunk/lib/luasql-2.1.1/src/jdbc/src/lua/ trunk/lib/luasql-2.1.1/src/jdbc/src/lua/jdbc.lua trunk/lib/luasql-2.1.1/src/ls_mysql.c trunk/lib/luasql-2.1.1/src/ls_oci8.c trunk/lib/luasql-2.1.1/src/ls_odbc.c trunk/lib/luasql-2.1.1/src/ls_postgres.c trunk/lib/luasql-2.1.1/src/ls_sqlite.c trunk/lib/luasql-2.1.1/src/ls_sqlite3.c trunk/lib/luasql-2.1.1/src/luasql.c trunk/lib/luasql-2.1.1/src/luasql.h trunk/lib/luasql-2.1.1/src/mysql.def trunk/lib/luasql-2.1.1/src/oci8.def trunk/lib/luasql-2.1.1/src/odbc.def trunk/lib/luasql-2.1.1/src/postgres.def trunk/lib/luasql-2.1.1/src/sqlite.def trunk/lib/luasql-2.1.1/src/sqlite3.def trunk/lib/luasql-2.1.1/tests/ trunk/lib/luasql-2.1.1/tests/ado.lua trunk/lib/luasql-2.1.1/tests/example.lua trunk/lib/luasql-2.1.1/tests/mysql.lua trunk/lib/luasql-2.1.1/tests/oci8.lua trunk/lib/luasql-2.1.1/tests/odbc.lua trunk/lib/luasql-2.1.1/tests/performance.lua trunk/lib/luasql-2.1.1/tests/postgres.lua trunk/lib/luasql-2.1.1/tests/sqlite.lua trunk/lib/luasql-2.1.1/tests/sqlite3.lua trunk/lib/luasql-2.1.1/tests/test.lua trunk/lib/luasql-2.1.1/vc6/ trunk/lib/luasql-2.1.1/vc6/def.tmpl trunk/lib/luasql-2.1.1/vc6/luasql.dsw trunk/lib/luasql-2.1.1/vc6/luasqlmysql40_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqlmysql41_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqlmysql50_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqloci8_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqlodbc_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqlpostgres_dll.dsp trunk/lib/luasql-2.1.1/vc6/luasqlsqlite_dll.dsp trunk/lib/luasql-2.1.1/vc6/mysql.def trunk/lib/luasql-2.1.1/vc6/mysql40.rc trunk/lib/luasql-2.1.1/vc6/mysql41.rc trunk/lib/luasql-2.1.1/vc6/mysql50.rc trunk/lib/luasql-2.1.1/vc6/oci8.def trunk/lib/luasql-2.1.1/vc6/odbc.def trunk/lib/luasql-2.1.1/vc6/postgres.def trunk/lib/luasql-2.1.1/vc6/postgres.rc trunk/lib/luasql-2.1.1/vc6/resource.h trunk/lib/luasql-2.1.1/vc6/sqlite.def trunk/lib/luaunit_v13/ trunk/lib/luaunit_v13/LICENSE.txt trunk/lib/luaunit_v13/README.txt trunk/lib/luaunit_v13/luaunit.lua trunk/lib/luaunit_v13/test_luaunit.lua trunk/lib/luaunit_v13/use_luaunit.lua Added: trunk/lib/luasql-2.1.1/Makefile =================================================================== --- trunk/lib/luasql-2.1.1/Makefile (rev 0) +++ trunk/lib/luasql-2.1.1/Makefile 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,42 @@ +V= 2.1.1 +CONFIG= ./config + +include $(CONFIG) + +ifeq "$(LUA_VERSION_NUM)" "500" +COMPAT_O= $(COMPAT_DIR)/compat-5.1.o +endif + +OBJS= src/luasql.o src/ls_$T.o $(COMPAT_O) + + +SRCS= src/luasql.h src/luasql.c \ + src/ls_postgres.c \ + src/ls_odbc.c \ + src/ls_oci8.c \ + src/ls_mysql.c \ + src/ls_sqlite.c + +AR= ar rcu +RANLIB= ranlib + + +lib: src/$(LIBNAME) + +src/$(LIBNAME): $(OBJS) + export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) -o $@ $(LIB_OPTION) $(OBJS) $(DRIVER_LIBS) + +$(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c + $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c + +install: + mkdir -p $(LUA_LIBDIR)/luasql + cp src/$(LIBNAME) $(LUA_LIBDIR)/luasql + +jdbc_driver: + cd src/jdbc; make $@ + +clean: + rm -f src/$(LIBNAME) src/*.o $(COMPAT_O) + +# $Id: Makefile,v 1.54 2007/10/29 21:44:54 carregal Exp $ Added: trunk/lib/luasql-2.1.1/Makefile.win.ado =================================================================== --- trunk/lib/luasql-2.1.1/Makefile.win.ado (rev 0) +++ trunk/lib/luasql-2.1.1/Makefile.win.ado 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,8 @@ +LUA_DIR=c:\lua5.1\lua + +install: + IF NOT EXIST $(LUA_DIR)\luasql mkdir $(LUA_DIR)\luasql + copy src\ado\ado.lua $(LUA_DIR)\luasql + +clean: + Added: trunk/lib/luasql-2.1.1/Makefile.win.mysql =================================================================== --- trunk/lib/luasql-2.1.1/Makefile.win.mysql (rev 0) +++ trunk/lib/luasql-2.1.1/Makefile.win.mysql 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,32 @@ +LUA_INC=c:\lua5.1\include +LUA_DIR=c:\lua5.1\lua +LUA_LIBDIR=c:\lua5.1 +LUA_LIB=c:\lua5.1\lua5.1.lib + +T=mysql + +DRIVER_INCLUDE= /I"c:\Program Files\MySQL\MySQL Server 5.0\include" +DRIVER_LIBS= "C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\libmySQL.lib" "C:\Program Files\MySQL\MySQL Server 5.0\lib\opt\mysqlclient.lib" + +OBJS= src\luasql.obj src\ls_$T.obj + +.c.obj: + cl /c /Fo$@ /O2 /I$(LUA_INC) /DWIN32 /D_CRT_SECURE_NO_DEPRECATE $(DRIVER_INCLUDE) $< + +src\$T.dll: $(OBJS) + link /dll /def:src\$T.def /out:$@ $(OBJS) $(DRIVER_LIBS) $(LUA_LIB) + +install: + IF NOT EXIST $(LUA_LIBDIR)\luasql mkdir $(LUA_LIBDIR)\luasql + copy src\$T.dll $(LUA_LIBDIR)\luasql + +jdbc_driver: + cd src\jdbc + nmake -f Makefile.win $@ + +clean: + del src\$T.dll + del src\$T.exp + del src\$T.lib + del $(OBJS) + Added: trunk/lib/luasql-2.1.1/Makefile.win.odbc =================================================================== --- trunk/lib/luasql-2.1.1/Makefile.win.odbc (rev 0) +++ trunk/lib/luasql-2.1.1/Makefile.win.odbc 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,32 @@ +LUA_INC=c:\lua5.1\include +LUA_DIR=c:\lua5.1\lua +LUA_LIBDIR=c:\lua5.1 +LUA_LIB=c:\lua5.1\lua5.1.lib + +T=odbc + +DRIVER_INCLUDE= +DRIVER_LIBS=odbc32.lib + +OBJS= src\luasql.obj src\ls_$T.obj + +.c.obj: + cl /c /Fo$@ /O2 /I$(LUA_INC) /D_CRT_SECURE_NO_DEPRECATE $(DRIVER_INCLUDE) $< + +src\$T.dll: $(OBJS) + link /dll /def:src\$T.def /out:$@ $(OBJS) $(DRIVER_LIBS) $(LUA_LIB) + +install: + IF NOT EXIST $(LUA_LIBDIR)\luasql mkdir $(LUA_LIBDIR)\luasql + copy src\$T.dll $(LUA_LIBDIR)\luasql + +jdbc_driver: + cd src\jdbc + nmake -f Makefile.win $@ + +clean: + del src\$T.dll + del src\$T.exp + del src\$T.lib + del $(OBJS) + Added: trunk/lib/luasql-2.1.1/Makefile.win.sqlite3 =================================================================== --- trunk/lib/luasql-2.1.1/Makefile.win.sqlite3 (rev 0) +++ trunk/lib/luasql-2.1.1/Makefile.win.sqlite3 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,32 @@ +LUA_INC=c:\lua5.1\include +LUA_DIR=c:\lua5.1\lua +LUA_LIBDIR=c:\lua5.1 +LUA_LIB=c:\lua5.1\lua5.1.lib + +T=sqlite3 + +DRIVER_INCLUDE= /I"c:\sqlite3" +DRIVER_OBJ="c:\sqlite3\sqlite3.obj" + +OBJS= src\luasql.obj src\ls_$T.obj $(DRIVER_OBJ) + +.c.obj: + cl /c /Fo$@ /O2 /I$(LUA_INC) /DWIN32 /D_CRT_SECURE_NO_DEPRECATE $(DRIVER_INCLUDE) $< + +src\$T.dll: $(OBJS) + link /dll /def:src\$T.def /out:$@ $(OBJS) $(LUA_LIB) + +install: + IF NOT EXIST $(LUA_LIBDIR)\luasql mkdir $(LUA_LIBDIR)\luasql + copy src\$T.dll $(LUA_LIBDIR)\luasql + +jdbc_driver: + cd src\jdbc + nmake -f Makefile.win $@ + +clean: + del src\$T.dll + del src\$T.exp + del src\$T.lib + del $(OBJS) + Added: trunk/lib/luasql-2.1.1/README =================================================================== --- trunk/lib/luasql-2.1.1/README (rev 0) +++ trunk/lib/luasql-2.1.1/README 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,20 @@ +LuaSQL 2.1 +http://www.keplerproject.org/luasql/ + +LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to: + + * Connect to ODBC, ADO, Oracle, MySQL, SQLite and PostgreSQL databases; + * Execute arbitrary SQL statements; + * Retrieve results in a row-by-row cursor fashion. + +LuaSQL is free software and uses the same license as Lua 5.1. + + +Source code for LuaSQL can be downloaded from the LuaForge page. + +If you are using LuaBinaries a Windows binary version of LuaSQL can be found at the same LuaForge page. + +LuaSQL 2.1.1 [29/Oct/2007] +* Fixed a bug in the SQLite3 error handling (patch by David Burgess) +* Fixed bug [#1834] for SQLite 3 (found by Savin Zlobec, patch by Marc Nijdam) +* Fixed bug [#1770] for SQLite 3 (found by Enrico Tassi, patch by Marc Nijdam) \ No newline at end of file Added: trunk/lib/luasql-2.1.1/config =================================================================== --- trunk/lib/luasql-2.1.1/config (rev 0) +++ trunk/lib/luasql-2.1.1/config 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,59 @@ +# Driver (leave uncommented ONLY the line with the name of the driver) +#T= mysql +#T= oci8 +#T= odbc +#T= postgres +#T= sqlite +T=sqlite3 + +# Installation directories + +# Default prefix +PREFIX = /usr/local + +# System's libraries directory (where binary libraries are installed) +LUA_LIBDIR= $(PREFIX)/lib/lua/5.1 + +# System's lua directory (where Lua libraries are installed) +LUA_DIR= $(PREFIX)/share/lua/5.1 + +# Lua includes directory +LUA_INC= $(PREFIX)/include + +# Lua version number (first and second digits of target version) +LUA_VERSION_NUM= 501 + +# OS dependent +LIB_OPTION= -shared #for Linux +#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X + +LIBNAME= $T.so +COMPAT_DIR= ../compat/src + +# Compilation parameters +# Driver specific +######## MySQL +#DRIVER_LIBS= -L/usr/local/mysql/lib -lmysqlclient -lz +#DRIVER_INCS= -I/usr/local/mysql/include +######## Oracle OCI8 +#DRIVER_LIBS= -L/home/oracle/OraHome1/lib -lz -lclntsh +#DRIVER_INCS= -I/home/oracle/OraHome1/rdbms/demo -I/home/oracle/OraHome1/rdbms/public +######## PostgreSQL +#DRIVER_LIBS= -L/usr/local/pgsql/lib -lpq +#DRIVER_INCS= -I/usr/local/pgsql/include +######## SQLite +#DRIVER_LIBS= -lsqlite +#DRIVER_INCS= +######## SQLite3 +DRIVER_LIBS= -L/opt/local/lib -lsqlite3 +DRIVER_INCS= -I/opt/local/include +######## ODBC +#DRIVER_LIBS= -L/usr/local/lib -lodbc +#DRIVER_INCS= -DUNIXODBC -I/usr/local/include + +WARN= -Wall -Wmissing-prototypes -Wmissing-declarations -ansi -pedantic +INCS= -I$(LUA_INC) +CFLAGS= -O2 $(WARN) -I$(COMPAT_DIR) $(DRIVER_INCS) $(INCS) $(DEFS) +CC= gcc + +# $Id: config,v 1.8 2007/10/27 22:55:27 carregal Exp $ Added: trunk/lib/luasql-2.1.1/doc/br/examples.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/br/examples.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/br/examples.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,166 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>LuaSQL: Conectividade de banco de dados para a linguagem de programação Lua</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><strong>LuaSQL</strong></big></div> + <div id="product_description">Conectividade de banco de dados para a linguagem de programação Lua</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><a href="index.html">Home</a> + <ul> + <li><a href="index.html#overview">Visão Geral</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Créditos</a></li> + <li><a href="index.html#contact">Contato</a></li> + </ul> + </li> + <li><a href="manual.html">Manual</a> + <ul> + <li><a href="manual.html#introduction">Introdução</a></li> + <li><a href="manual.html#compiling">Compilando</a></li> + <li><a href="manual.html#installation">Instalação</a></li> + <li><a href="manual.html#errors">Tratamento de erros</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Ambiente</a></li> + <li><a href="manual.html#connection_object">Conexão</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><strong>Exemplos</strong></li> + <li><a href="history.html">Histórico</a></li> + <li><a href="http://luaforge.net/projects/luasql/">Projeto</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><a href="license.html">Licença</a></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> + +<h2><a name="examples"></a>Exemplos</h2> + +<p>Abaixo, você verá um pequeno exemplo do código do uso básico da biblioteca. +Em seguida, outro exemplo mostra como criar um +<a href="#iterator_example">iterador</a> sobre o resultado de uma determinada consulta.</p> + + +<h3><a name="basic_use"></a>Uso básico</h3> +<pre class="example"> +-- carregar o driver +require "luasql.postgres" +-- criar o objeto de ambiente +env = assert (luasql.postgres()) +-- conectar a base de dados +con = assert (env:connect("luasql-test")) +-- retornar a tabela +res = con:execute"DROP TABLE people" +res = assert (con:execute[[ + CREATE TABLE people ( + name varchar(50), + email varchar(50) + ) +]]) +-- adiciona alguns elementos +list = { + { name="José das Couves", email="jo...@co...", }, + { name="Manoel Joaquim", email="man...@ca...", }, + { name="Maria das Dores", email="ma...@do...", }, +} +for i, p in pairs (list) do + res = assert (con:execute(string.format([[ + INSERT INTO people + VALUES ('%s', '%s')]], p.name, p.email) + )) +end +-- obtem um cursor +cur = assert (con:execute"SELECT name, email from people") +-- imprime todos os registros, indexados pelos nomes de campos +row = cur:fetch ({}, "a") +while row do + print(string.format("Nome: %s, E-mail: %s", row.name, row.email)) + -- reutiliza a tabela de resultados + row = cur:fetch (row, "a") +end +-- fecha tudo +cur:close() +con:close() +env:close() +</pre> + +<p>O resultado desse script será:</p> + +<pre class="example"> +Nome: José das Couves, E-mail: jo...@co... +Nome: Manoel Joaquim, E-mail: man...@ca... +Nome: Maria das Dores, E-mail: ma...@do... +</pre> + + +<h3><a name="iterator_example"></a>Uso do iterador</h3> +<p>Pode ser útil oferecer um iterador para cada registro do resultado:</p> + +<pre class="example"> +function rows (connection, sql_statement) + local cursor = assert (connection:execute (sql_statement)) + return function () + return cursor:fetch() + end +end +</pre> + +<p>Esse iterador é usado da seguinte forma:</p> + +<pre class="example"> +require "luasql.mysql" +env = assert (luasql.mysql()) +con = assert (env:connect"my_db") +for id, name, address in rows (con, "select * from contacts") do + print (string.format ("%s: %s", name, address)) +end +</pre> + +<p>A implementação acima utiliza a coleta de lixo de Lua para +fechar o cursor. Ela pode ser melhorada de modo a apresentar +mensagens de erro mais adequadas (incluindo o statement SQL por +exemplo) ou para fechar explicitamente o cursor (verificando +se ainda existem mais linhas).</p> + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> + <p><small> + $Id: examples.html,v 1.6 2006/05/29 21:44:44 carregal Exp $ + </small></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> + +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/br/history.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/br/history.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/br/history.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,127 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>LuaSQL: Conectividade de banco de dados para a linguagem de programação Lua</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> + +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><strong>LuaSQL</strong></big></div> + <div id="product_description">Conectividade de banco de dados para a linguagem de programação Lua</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><a href="index.html">Home</a> + <ul> + <li><a href="index.html#overview">Visão Geral</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Créditos</a></li> + <li><a href="index.html#contact">Contato</a></li> + </ul> + </li> + <li><a href="manual.html">Manual</a> + <ul> + <li><a href="manual.html#introduction">Introdução</a></li> + <li><a href="manual.html#compiling">Compilando</a></li> + <li><a href="manual.html#installation">Instalação</a></li> + <li><a href="manual.html#errors">Tratamento de erros</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Ambiente</a></li> + <li><a href="manual.html#connection_object">Conexão</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><a href="examples.html">Exemplos</a></li> + <li><strong>Histórico</strong></li> + <li><a href="http://luaforge.net/projects/luasql/">Projeto</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><a href="license.html">Licença</a></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> + +<h2><a name="history"></a>História</h2> + +<dl class="history"> + <dt><strong>2.0.2</strong> [26/06/2006]</dt> + <dd>Método <a href="manual.html#mysql_extensions">numrows</a> acrescentado ao driver MySQL.<br /> + Adicionado um arquivo <code>config</code> para o <code>makefile</code>.<br /> + Adicionada configuração do driver LinuxODBC.<br /> + Corrigiu um bug no driver SQLite (bug encontrado por Mike Petersen).<br /> + Corrigiu bugs nos drivers JDBC, OCI8 e ADO.<br /> + Testes melhorados.<br /> + Documentação melhorada.<br /> + </dd> + + <dt><strong>2.0.1</strong> [02/06/2005]</dt> + <dd>Corrigiu alguns erros relativos ao driver ODBC.</dd> + + <dt><strong>2.0.0</strong> [22/03/2005]</dt> + <dd>Novo driver ADO e corrigiu alguns erros relativos ao driver ODBC.</dd> + + <dt><strong>2.0 beta 3</strong> [23/12/2004]</dt> + <dd>Corrigiu apenas alguns pequenos erros.</dd> + + <dt><strong>2.0 beta 2</strong> [26/11/2004]</dt> + <dd>Corrigiu alguns erros e introduziu os novos drivers SQLite and JDBC. + Utiliza a + <a href="http://www.keplerproject.org/compat/">proposta de pacotes</a> + para Lua 5.1. Veja mais detalhes em + <a href="manual.html#installation">Instalação</a>. + </dd> + + <dt><strong>2.0 beta</strong> [10/12/2003]</dt> +</dl> + + +<p> +A versão 2.0 apresenta algumas modificações no design e aprimoramentos +na implementação em relação à versão 1.0: +</p> +<ul> + <li>Novo método de <code>fetch</code>: mais eficiente e mais flexível;</li> + <li>Novo método de <code>setautocommit</code>;</li> + <li>Compatível com Lua 5.0 e 5.1;</li> + <li>Carregável dinamicamente ou estaticamente;</li> + <li>Novos drivers para bancos de dados Oracle e MySQL.</li> +</ul> + +<p> </p> +<p> </p> +<p> </p> + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"> + <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> + <p><small>$Id: history.html,v 1.10 2006/06/26 17:18:35 carregal Exp $</small> + </p> +</div> <!-- id="about" --> +</div> <!-- id="container" --> +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/br/index.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/br/index.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/br/index.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,156 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>LuaSQL: Conectividade de banco de dados para a linguagem de programação Lua</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> + +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><strong>LuaSQL</strong></big></div> + <div id="product_description">Conectividade de banco de dados para a linguagem de programação Lua</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><strong>Home</strong> + <ul> + <li><a href="index.html#overview">Visão Geral</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Créditos</a></li> + <li><a href="index.html#contact">Contato</a></li> + </ul> + </li> + <li><a href="manual.html">Manual</a> + <ul> + <li><a href="manual.html#introduction">Introdução</a></li> + <li><a href="manual.html#compiling">Compilando</a></li> + <li><a href="manual.html#installation">Instalação</a></li> + <li><a href="manual.html#errors">Tratamento de erros</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Ambiente</a></li> + <li><a href="manual.html#connection_object">Conexão</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><a href="examples.html">Exemplos</a></li> + <li><a href="history.html">Histórico</a></li> + <li><a href="http://luaforge.net/projects/luasql/">Projeto</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><a href="license.html">Licença</a></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> +<h2><a name="overview"></a>Visão Geral</h2> +<p> +LuaSQL é uma interface simples entre Lua e um sistema gerenciador de banco de dados (DBMS). Ela permite que um programa Lua: +</p> +<ul> + <li> Conecte-se aos bancos de dados ODBC, ADO, Oracle, MySQL, SQLite, JDBC e PostgreSQL;</li> + <li> Execute comandos arbritários do SQL;</li> + <li> Recupere resultados no modo linha-a-linha de um cursor SQL.</li> +</ul> + +<p> +LuaSQL é um software livre e utiliza a mesma <a href="license.html">licença</a> +do Lua 5.0. +</p> + +<h2><a name="status"></a>Status</h2> +<p>A versão LuaSQL 2.0.2 (para Lua 5.0) está disponível para +<a href="#download">download</a>. +</p> + +<p>O driver PostgreSQL foi testado em Windows, Linux e MacOS X e é compatível com +PostgreSQL 7.x e 8.x.</p> +<p>O driver ODBC foi testado em Windows (drivers SQLServer e Microsoft Access).</p> +<p>O driver MySQL foi testado em Windows, Linux e é compatível com as versões 4.0, 4.1 e 5.0.</p> +<p>O driver Oracle foi testado em Windows e é compatível com OCI 8 API.</p> +<p>O driver SQLite foi testado em Windows e Linux e é compatível com as versões 2.x.</p> +<p>O driver JDBC foi testado em Windows com LuaJava 1.0 e JDK 1.4 (driver MySQL).</p> +<p>O driver ADO foi testado em Windows, com LuaCOM 1.3 (driver Microsoft Access).</p> + +<h2><a name="download"></a>Download</h2> +<p> +O download do código fonte do LuaSQL pode ser feito a partir da sua +página no +<a href="http://luaforge.net/project/showfiles.php?group_id=12">LuaForge</a>. +Para os usuários do +<a href="http://luaforge.net/projects/luabinaries/">LuaBinaries</a> 5.0.2 Release 2 +uma versão compilada dos drivers do LuaSQL pode ser encontrada na mesma página +do LuaForge. +</p> + +<h2><a name="credits"></a>Créditos</h2> + +<h4>LuaSQL 2.0</h4> +<p> +A Versão 2.0 foi redesenhada por Roberto Ierusalimschy, André Carregal +e Tomás Guisasola como parte do +<a href="http://www.keplerproject.org">Projeto Kepler</a>. +A implementação é compatível com Lua 5.0 e foi codificada por Tomás Guisasola, Eduardo Quintão, Thiago Ponte, Fabio Mascarenhas, Danilo Tuler, +com inestimáveis contribuições de Michael Roth, Tiago Dionizio e Leonardo Godinho. +</p> + +<h4>LuaSQL 1.0</h4> +<p> +LuaSQL foi projetado por Pedro Miller Rabinovitch e Roberto +Ierusalimschy. +A primeira implementação era compatível com Lua 4.0a. +Muitas modificações foram feitas, mas não distribuídas, por Diego Nehab (ODBC), +Carlos Cassino, Tomás Guisasola and Eduardo Quintão (PostgreSQL). +</p> +<p> +O desenvolvimento de LuaSQL foi patrocinado pela +<a href="http://www.fabricadigital.com.br">Fábrica Digital</a>, FINEP e CNPq. +</p> + +<h2><a name="contact"></a>Contato</h2> + +<p> +Para mais informações, entre em +<a href="mailto:inf...@ke...">contato</a> conosco. +Comentários são muito bem-vindos! +</p> + +<p> +A <a href="http://luaforge.net/mail/?group_id=104">lista de discussão</a> +do projeto Kepler é outra forma de entrar em contato com desenvolvedores +e usuários da plataforma Kepler. +</p> + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"> + <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> + <p><small>$Id: index.html,v 1.8 2006/06/26 18:29:05 carregal Exp $</small> + </p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> + +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/br/license.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/br/license.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/br/license.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,122 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>Licença LuaSQL</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> + +<body> +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><strong>LuaSQL</strong></big></div> + <div id="product_description">Conectividade de banco de dados para a linguagem de programação Lua</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><a href="index.html">Home</a> + <ul> + <li><a href="index.html#overview">Visão Geral</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Créditos</a></li> + <li><a href="index.html#contact">Contato</a></li> + </ul> + </li> + <li><a href="manual.html">Manual</a> + <ul> + <li><a href="manual.html#introduction">Introdução</a></li> + <li><a href="manual.html#compiling">Compilando</a></li> + <li><a href="manual.html#installation">Instalação</a></li> + <li><a href="manual.html#errors">Tratamento de erros</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Ambiente</a></li> + <li><a href="manual.html#connection_object">Conexão</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><a href="examples.html">Exemplos</a></li> + <li><a href="history.html">Histórico</a></li> + <li><a href="http://luaforge.net/projects/luasql/">Projeto</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><strong>Licença</strong></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> +<h2>License</h2> + +<p>LuaSQL is free software: +it can be used for both academic and commercial purposes at absolutely no cost. +There are no royalties or GNU-like "copyleft" restrictions. +LuaSQL qualifies as +<a href="http://www.opensource.org/docs/definition.html">Open Source</a> +software. +Its licenses are compatible with +<a href="http://www.gnu.org/licenses/gpl.html">GPL</a>. +LuaSQL is not in the public domain and the +<a href="http://www.keplerproject.org">Kepler Project</a> +keep its copyright. +The legal details are below.</p> + +<p>The spirit of the license is that +you are free to use LuaSQL for any purpose at no cost without having to ask us. +The only requirement is that if you do use LuaSQL, +then you should give us credit by including the appropriate copyright notice +somewhere in your product or its documentation.</p> + +<p>The LuaSQL library is designed and implemented by the +<a href="http://www.keplerproject.org">Kepler Project</a> team. +The implementation is not derived from licensed software.</p> + +<hr/> +<p>Copyright © 2003-2006 The Kepler Project.</p> + +<p>Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions:</p> + +<p>The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software.</p> + +<p> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.</p> + +</div> <!-- id="content" --> +</div> <!-- id="main" --> + +<div id="about"> +<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> +<p><small> +$Id: license.html,v 1.5 2006/05/29 21:44:44 carregal Exp $ +</small></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/br/luasql.png =================================================================== (Binary files differ) Property changes on: trunk/lib/luasql-2.1.1/doc/br/luasql.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/lib/luasql-2.1.1/doc/br/manual.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/br/manual.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/br/manual.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,390 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <title>LuaSQL: Conectividade de banco de dados para a linguagem de programação Lua</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> + +<body> +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><strong>LuaSQL</strong></big></div> + <div id="product_description">Conectividade de banco de dados para a linguagem de programação Lua</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><a href="index.html">Home</a> + <ul> + <li><a href="index.html#overview">Visão Geral</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Créditos</a></li> + <li><a href="index.html#contact">Contato</a></li> + </ul> + </li> + <li><strong>Manual</strong> + <ul> + <li><a href="manual.html#introduction">Introdução</a></li> + <li><a href="manual.html#compiling">Compilando</a></li> + <li><a href="manual.html#installation">Instalação</a></li> + <li><a href="manual.html#errors">Tratamento de erros</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Ambiente</a></li> + <li><a href="manual.html#connection_object">Conexão</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><a href="examples.html">Exemplos</a></li> + <li><a href="history.html">Histórico</a></li> + <li><a href="http://luaforge.net/projects/luasql/">Projeto</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><a href="license.html">Licença</a></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> + +<h2><a name="introduction"></a>Introdução</h2> +<p>LuaSQL é uma interface simples entre Lua e diversos sistemas gerenciadores de bancos de dados (DBMS) populares +(atualmente PostgreSQL, ODBC, JDBC, MySQL, SQLite, Oracle e ADO; Interbase e Sybase estão nos nossos planos). +LuaSQL define uma API orientada a objetos. Todos os drivers devem implementar essa API comum, +mas cada um é livre para oferecer extensões.</p> + +<p>LuaSQL define uma única variável global: uma tabela chamada <code>luasql</code>. +Essa tabela é usada para armazenar os métodos de inicialização dos drivers instalados. +Esses métodos são usados para criar um +<a href="#environment_object">ambiente</a>, +o qual é usado para criar uma +<a href="#connection_object">conexão</a>. +A conexão pode executar comandos SQL e, eventualmente, criar um +<a href="#cursor_object">cursor</a>, utilizado para recuperar dados.</p> + +<p>LuaSQL é um software livre e usa a mesma <a href="license.html">licença</a> do Lua 5.0.</p> + +<h2><a name="compiling"></a>Compilando</h2> + +<p>LuaSQL é distribuído como um conjunto de arquivos fonte C – +um arquivo fonte e um arquivo cabeçalho comuns a todos os drivers +(<code>luasql.h</code> e <code>luasql.c</code>) – e um arquivo fonte para cada driver. +Cada driver deve ser compilado juntamente com o arquivo <code>luasql.c</code> +para gerar uma biblioteca. Essa biblioteca pode ser linkada à aplicação +ou carregada dinamicamente. A função de inicialização é +<code>luaopen_luasql<em>nomedriver</em></code> e é compatível com o formato +<a href="http://www.lua.org/manual/5.1/manual.html#pdf-require"><code>open-library</code></a> de Lua.</p> + +<h2><a name="installation"></a>Instalação</h2> + +<p>Todos os drivers LuaSQL seguem a +<a href="http://www.keplerproject.org/compat">proposta de pacotes</a> +para Lua 5.1. Logo, esse pacote deve ser "instalado". Consulte a seção de +<a href="http://www.keplerproject.org/compat/manual.html#configuration"> +configuração do Compat-5.1</a> para saber como instalar os pacotes binários +da maneira correta. +As bibliotecas compiladas devem ser instaladas em um diretório chamado +<code>luasql</code> no seu LUA_CPATH.</p> + +<p>Usuários Windows podem utilizar os pacotes compilados do LuaSQL disponíveis na +página do +<a href="http://luaforge.net/projects/luasql/files">LuaForge</a></p> + +<p>Para usar LuaSQL com o JDBC, certifique-se que:</p> +<ul> + <li> Lua está rodando com <a href="http://www.keplerproject.org/luajava/">LuaJava</a></li> + <li> O jar do LuaSQL está na classpath da máquina virtual do Java</li> + <li> O driver JDBC do banco de dados desejado também está na classpath + da máquina virtual</li> +</ul> + +<p>Para usar LuaSQL com ADO, certifique-se que Lua está rodando com + <a href="http://www.tecgraf.puc-rio.br/~rcerq/luacom">LuaCOM 1.3</a></p> + +<h2><a name="errors"></a>Tratamento de erros</h2> + +<p>LuaSQL é apenas uma camada abstrata de comunicação entre Lua +e um sistema de banco de dados. Portanto, erros podem ocorrem em ambos os níveis: +no cliente do banco de dados ou no driver LuaSQL.</p> + +<p>Erros como comandos SQL mal formados, nomes de tabela desconhecidos etc., chamados +<em>erros de banco de dados</em>, serão reportados pelo retorno de <code>nil</code> +pela função/método, seguido de uma mensagem de erro enviada pelo +sistema de banco de dados. Erros como parâmetros inválidos, ausência +de conexão, objetos inválidos etc., chamados <em>erros de API</em>, +são usualmente erros de programação e geram erros Lua.</p> + +<p>Esse comportamento vale para todas as funções/métodos descritos +neste documento, a menos que seja especificado de outra forma.</p> + +<h2><a name="drivers"></a>Drivers</h2> + +<p> +Um driver LuaSQL permite o uso da API LuaSQL com um determinado banco de dados. Para usar +um driver, este deve ser carregado na tabela <code>luasql</code>. O exemplo abaixo +</p> + +<pre class="example"> +require "luasql.odbc" +</pre> + +<p> +carrega o driver ODBC na tabela <code>luasql</code>. Note que pode-se ter mais de um driver +carregado usando-se algo como: +</p> + +<pre class="example"> +require "luasql.odbc" +require "luasql.oci8" +</pre> + +<p> +Este exemplo também mostra que o nome do driver nem sempre corresponde ao +nome do banco de dados, mas sim ao nome do driver no sistema de arquivos. Dado que +o driver Oracle se refere à API OCI8, ele recebe o nome de <code>oci8</code> +ao invés de <code>oracle</code>. +</p> + +<p> +Alguns drivers, tais como o MySQL, tem bibliotecas para versões diferentes +do banco de dados MySQL mas utilizam o mesmo nome de arquivo (<code>mysql</code>). +Neste caso não é possível carregar mais de uma versão +do driver MySQL na tabela <code>luasql</code>. +</p> + +<h2><a name="environment_object"></a>Ambiente</h2> + +<p>Um ambiente é criado chamando a função de inicialização +do driver que está armazenada na tabela <code>luasql</code> com o mesmo nome do driver +(odbc, postgres etc). Por exemplo,</p> + +<pre class="example"> +env = luasql.odbc() +</pre> + +<p>tentará criar um ambiente usando o driver ODBC. A única exceção +é o driver JDBC, que precisa saber que driver interno utilizar. +Logo, quando se cria um ambiente, deve-se passar o nome da classe do driver como primeiro +parâmetro para a função <code>luasql.jdbc</code>. Por exemplo:</p> + +<pre class="example"> +env = luasql.jdbc ("com.mysql.jdbc.Driver") +</pre> + +<h4>Métodos</h4> + +<dl class="reference"> + <dt><a name="env_close"></a><strong><code>env:close()</code></strong></dt> + <dd>Fecha o ambiente <code>env</code>. Só é bem sucedido se todas as suas + conexões já tiverem sido fechadas anteriormente.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code>, quando o ambiente + já estiver fechado. + </dd> + + <dt><a name="env_connect"></a><strong><code>env:connect(sourcename[,username[,password]])</code></strong></dt> + <dd>Conecta à fonte de dados especificada em <code>sourcename</code> usando + <code>username</code> e <code>password</code> se eles são fornecidos.<br/> + O <code>sourcename</code> pode variar de acordo com cada driver. + Alguns usam simplesmente o nome do banco de dados, como PostgreSQL, MySQL e SQLite; + o driver ODBC recebe o nome de DSN; o driver Oracle recebe o nome do serviço; e + o driver JDBC recebe um comando como + <code>"jdbc:<database system>://<database name>"</code>, o qual é + específico para cada driver.<br/> + Veja também: <a href="#postgres_extensions">PostgreSQL</a> e + <a href="#mysql_extensions">MySQL</a>.<br/> + Retorna: uma <a href="#connection_object">conexão</a>. + </dd> +</dl> + + +<h2><a name="connection_object"></a>Conexão</h2> + +<p>Uma conexão contém atributos e parâmetros específicos de uma +única conexão de base de dados. Uma conexão é criada chamando +o método <code><a href="#env_connect">environment:connect</a></code>.</p> + +<h4>Métodos</h4> + +<dl class="reference"> + <dt><a name="conn_close"></a><strong><code>conn:close()</code></strong></dt> + <dd>Fecha a conexão <code>conn</code>. Só é bem sucedido se todos + os seus cursores tiverem sido fechados anteriormente e se a conexão ainda estiver aberta.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code> em caso de fracasso. + </dd> + + <dt><a name="conn_commit"></a><strong><code>conn:commit()</code></strong></dt> + <dd>Efetua a transação corrente. Esse atributo pode não funcionar + em sistemas de banco de dados que não implementam transações.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code>, quando + a operação não pode ser realizada ou não está implementada. + </dd> + + <dt><a name="conn_execute"></a><strong><code>conn:execute(statement)</code></strong></dt> + <dd>Executa o <code>statement</code> SQL dado.<br/> + Retorna: o <a href="#cursor_object">cursor</a>, se houver resultados, ou o número + de registros alterados pelo comando. + </dd> + + <dt><a name="conn_rollback"></a><strong><code>conn:rollback()</code></strong></dt> + <dd>Desfaz a transação corrente. Esse atributo pode não funcionar + em sistemas de banco de dados que não implementam transações.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code>, quando + a operação não pode ser realizada ou não está implementada. + </dd> + + <dt><a name="conn_setautocommit"></a><strong><code>conn:setautocommit(boolean)</code></strong></dt> + <dd>Ativa ou desativa o modo "auto commit". Esse atributo pode não funcionar em sistemas + de banco de dados que não implementam transações. Em sistemas de banco + de dados que não trabalham com o conceito de "modo auto commit", mas que implementam + transações, esse mecanismo é implementado pelo driver.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code>, quando + a operação não pode ser realizada ou não está implementada. + </dd> +</dl> + + +<h2><a name="cursor_object"></a>Cursores</h2> + +<p>Um cursor contém métodos para recuperar dados resultantes de um comando executado. +Um cursor é criado por meio de uma função +<code><a href="#conn_execute">connection:execute</a></code>. +Veja também: <a href="#postgres_extensions">PostgreSQL</a> +e <a href="#oracle_extensions">Oracle</a>.</p> + +<h4>Métodos</h4> + +<dl class="reference"> + <dt><a name="cur_close"></a><strong><code>cur:close()</code></strong></dt> + <dd>Fecha esse cursor.<br/> + Retorna: <code>true</code>, em caso de sucesso; <code>false</code>, quando o cursor + já está fechado. + </dd> + + <dt><a name="cur_fetch"></a><strong><code>cur:fetch([table[,modestring]])</code></strong></dt> + <dd>Recupera o próximo registro do resultado.<br/> + Se <code>fetch</code> é chamado sem parâmetros, os resultados + consistem em uma lista de valores. Se <code>fetch</code> é + chamado com uma tabela, os resultados são copiados para a tabela e a tabela + é retornada. Neste caso, pode ser usado um + parâmetro opcional de modo (<code>modestring</code>): uma seqüência + de caracteres indicando como deve ser construída a tabela de resultados. + A seqüência de caracteres do modo pode conter: + <dl> + <dt><strong>"n"</strong></dt><dd>a tabela resultante terá índices numéricos (padrão)</dd> + <dt><strong>"a"</strong></dt><dd>a tabela resultante terá índices alfanuméricos</dd> + </dl> + <br/> + Os <em>índices numéricos</em> representam as posições dos + campos no comando SELECT; os <em>índices alfanuméricos</em> representam + os nomes dos campos.<br/> + A tabela opcional (<code>table</code>) será usada para armazenar o próximo + registro. Isso permite o uso de uma única tabela para várias chamadas, o que + pode melhorar o desempenho geral.<br/> + Não existe garantia sobre os tipos dos resultados: eles podem ou não ser convertidos pelo driver + para os tipos Lua adequados. Na implementação atual, os drivers PostgreSQL e MySQL + retornam todos os valores como strings, enquanto os drivers ODBC e Oracle convertem esses valores + em tipos Lua.<br/> + Retorna: dados, como descrito acima, ou <code>nil</code> se não existem mais registros. + Note que esse método pode retornar <code>nil</code> como um resultado válido. + </dd> + + <dt><a name="cur_colnames"></a><strong><code>cur:getcolnames()</code></strong></dt> + <dd>Retorna: uma tabela com os nomes das colunas. + </dd> + + <dt><a name="cur_coltypes"></a><strong><code>cur:getcoltypes()</code></strong></dt> + <dd>Retorna: uma tabela com os tipos das colunas. + </dd> +</dl> + +<p><a name="extensions"></a></p> + +<h2><a name="postgres_extensions"></a>PostgreSQL</h2> + +<p>Além das funcionalidades básicas oferecidas por todos os drivers, +o driver Postgres oferece as seguintes funcionalidades adicionais:</p> + +<dl class="reference"> + <dt><strong><code>env:connect(sourcename[,username[,password[,hostname[,port]]]])</code></strong></dt> + <dd>No driver PostgreSQL este método tem mais dois parâmetros opcionais que indicam + o <code>hostname</code> e a <code>port</code> a serem utilizados na conexão. + Além disso, o primeiro parâmetro também pode conter todas as informações + de conexão, como é dito na documentação + para a função <code>PQconnectdb</code> no manual do PostgreSQL + (ex. <small><code>environment:connect("dbname=<<em>name</em>> user=<<em>username</em>>")</code></small>)<br/> + Veja também: <a href="#environment_object">ambiente</a><br/> + Retorna: uma <a href="#connection_object">conexão</a> + </dd> + + <dt><strong><code>cur:numrows()</code></strong></dt> + <dd>Veja também: <a href="#cursor_object">cursores</a><br/> + Retorna: o número de registros no resultado da busca. + </dd> +</dl> + + +<h2><a name="mysql_extensions"></a>MySQL</h2> + +<p>Além das funcionalidades básicas oferecidas por todos os drivers, +o driver MySQL ainda oferece as seguintes funcionalidades adicionais:</p> + +<dl class="reference"> + <dt><strong><code>env:connect(sourcename[,username[,password[,hostname[,port]]]])</code></strong></dt> + <dd>No driver MySQL, esse método tem mais dois parâmetros opcionais que indicam o + <code>hostname</code> e a <code>port</code> a serem utilizados na conexão. + Veja também: <a href="#environment_object">ambiente</a><br/> + Retorna: uma <a href="#connection_object">conexão</a> + </dd> + + <dt><strong><code>cur:numrows()</code></strong></dt> + <dd>Veja também: <a href="#cursor_object">cursores</a><br/> + Retorna: o número de registros no resultado da busca. + </dd> +</dl> + +<p>Nota: Este driver é compatível com as versões 4.0, 4.1 e 5.0 da +API MySQL. Apenas as versões a partir de 4.1 oferecem suporte para transações, através de tabelas +BDB ou INNODB. Com a versão 4.0 ou sem um desses tipos de tabelas, os métodos +<code>commit</code>, <code>rollback</code> e <code>setautocommit</code> não funcionam.</p> + +<h2><a name="oracle_extensions"></a>Oracle</h2> + +<p>Além das funcionalidades básicas oferecidas por todos os drivers, +o driver Oracle ainda oferece uma funcionalidade adicional:</p> + +<dl class="reference"> + <dt><strong><code>cur:numrows()</code></strong></dt> + <dd>Veja também: <a href="#cursor_object">cursores</a><br/> + Retorna: o número de registros no resultado da pesquisa. + </dd> +</dl> + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p> + <p><small> + $Id: manual.html,v 1.10 2006/05/30 22:03:54 carregal Exp $ + </small></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> + +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/us/examples.html =================================================================== --- trunk/lib/luasql-2.1.1/doc/us/examples.html (rev 0) +++ trunk/lib/luasql-2.1.1/doc/us/examples.html 2008-01-16 02:40:45 UTC (rev 8) @@ -0,0 +1,165 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>LuaSQL: Database connectivity for the Lua programming language</title> + <link rel="stylesheet" href="http://www.keplerproject.org/doc.css" type="text/css"/> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> +</head> +<body> + +<div id="container"> + +<div id="product"> + <div id="product_logo"><a href="http://www.keplerproject.org"> + <img alt="LuaSQL logo" src="luasql.png"/> + </a></div> + <div id="product_name"><big><b>LuaSQL</b></big></div> + <div id="product_description">Database connectivity for the Lua programming language</div> +</div> <!-- id="product" --> + +<div id="main"> + +<div id="navigation"> +<h1>LuaSQL</h1> + <ul> + <li><a href="index.html">Home</a> + <ul> + <li><a href="index.html#overview">Overview</a></li> + <li><a href="index.html#status">Status</a></li> + <li><a href="index.html#download">Download</a></li> + <li><a href="index.html#credits">Credits</a></li> + <li><a href="index.html#contact">Contact us</a></li> + </ul> + </li> + <li><a href="manual.html">Manual</a> + <ul> + <li><a href="manual.html#introduction">Introduction</a></li> + <li><a href="manual.html#compiling">Compiling</a></li> + <li><a href="manual.html#installation">Installation</a></li> + <li><a href="manual.html#errors">Error handling</a></li> + <li><a href="manual.html#drivers">Drivers</a></li> + <li><a href="manual.html#environment_object">Environment</a></li> + <li><a href="manual.html#connection_object">Connection</a></li> + <li><a href="manual.html#cursor_object">Cursor</a></li> + <li><a href="manual.html#postgres_extensions">PostgreSQL</a></li> + <li><a href="manual.html#mysql_extensions">MySQL</a></li> + <li><a href="manual.html#oracle_extensions">Oracle</a></li> + </ul> + </li> + <li><strong>Examples</strong></li> + <li><a href="history.html">History</a></li> + <li><a href="http://luaforge.net/projects/luasql/">Project</a> + <ul> + <li><a href="http://luaforge.net/tracker/?group_id=12">Bug Tracker</a></li> + <li><a href="http://luaforge.net/scm/?group_id=12">CVS</a></li> + </ul> + </li> + <li><a href="license.html">License</a></li> + </ul> +</div> <!-- id="navigation" --> + +<div id="content"> + +<h2><a name="examples"></a>Examples</h2> + +<p>Here is an example of the basic use of the library. +After that, another example shows how to create an +<a href="#iterator_example">iterator</a> over the result of a SELECT +query.</p> + + +<h3><a name="basic_use"></a>Basic use</h3> +<pre class="example"> +-- load driver +require "luasql.postgres" +-- create environment object +env = assert (luasql.postgres()) +-- connect to data source +con = assert (env:connect("luasql-test")) +-- reset our table +res = con:execute"DROP TABLE people" +res = assert (con:execute[[ + CREATE TABLE people( + name varchar(50), + email varchar(50) + ) +]]) +-- add a few elements +list = { + { name="Jose das Couves", email="jo...@co...", }, + { name="Manoel Joaquim", email="man...@ca...", }, + { name="Maria das Dores", email="ma...@do...", }, +} +for i, p in pairs (list) do + res = assert (con:execute(string.format([[ + INSERT INTO people + VALUES ('%s', '%s')]], p.name, p.email) + )) +end +-- retrieve a cursor +cur = assert (con:execute"SELECT name, email from people") +-- print all rows, the rows will be indexed by field names +row = cur:fetch ({}, "a") +while row do + print(string.format("Name: %s, E-mail: %s", row.name, row.email)) + -- reusing the table of results + row = cur:fetch (row, "a") +end +-- close everything +cur:close() +con:close() +env:close() +</pre> + +<p>And the output of this script should be:</p> + +<pre class="example"> +Name: Jose das Couves, E-mail: jo...@co... +Name: Manoel Joaquim, E-mail: man...@ca... +Name: Maria das Dores, E-mail: ma...@do... +</pre> + + +<h3><a name="iterator_example"></a>Iterator use</h3> +<p>It may be useful to offer an iterator for the resulting rows:</p> + +<pre class="example"> +function rows (connection, sql_statement) + local cursor = assert (connection:execute (sql_statement)) + return function () + return cursor:fetch() + end +end +</pre> + +<p>Here is how the iterator is used:</p> + +<pre class="example"> +require "luasql.mysql" +env = assert (luasql.mysql()) +con = assert (env:connect"my_db") +for id, name, address in rows (con, "select * from contacts") do + print (string.format ("%s: %s", name, address)) +end +</pre> + +<p>The above implementation relies on the garbage collector to close +the cursor. It could be improved to give better error messages +(including the SQL statement) +or to explicitly close the cursor +(by checking whether there are no more rows).</p> + +</div> <!-- id="content" --> + +</div> <!-- id="main" --> + +<div id="about"> + <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> + <p><small>$Id: examples.html,v 1.15 2007/10/30 01:10:49 carregal Exp $</small></p> +</div> <!-- id="about" --> + +</div> <!-- id="container" --> + +</body> +</html> Added: trunk/lib/luasql-2.1.1/doc/us/history.html ================================================... [truncated message content] |
From: <rfb...@us...> - 2008-01-06 01:43:24
|
Revision: 7 http://questgen.svn.sourceforge.net/questgen/?rev=7&view=rev Author: rfboehme Date: 2008-01-05 17:43:19 -0800 (Sat, 05 Jan 2008) Log Message: ----------- Added Eclipse .project file Added Paths: ----------- trunk/.project Added: trunk/.project =================================================================== --- trunk/.project (rev 0) +++ trunk/.project 2008-01-06 01:43:19 UTC (rev 7) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>questgen</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.keplerproject.ldt.core.luaProjectBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.keplerproject.ldt.core.luaProjectNature</nature> + </natures> +</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2007-12-17 16:32:57
|
Revision: 6 http://questgen.svn.sourceforge.net/questgen/?rev=6&view=rev Author: rfboehme Date: 2007-12-17 08:32:55 -0800 (Mon, 17 Dec 2007) Log Message: ----------- Changed initial work spec, added bare modules for the objects therein to the source tree. Modified Paths: -------------- trunk/docs/Quest Generator - Inital Work Spec.txt Added Paths: ----------- trunk/docs/sample lists/ trunk/docs/sample lists/creatable item list.txt trunk/docs/sample lists/problem objects.txt trunk/docs/sample lists/problems.txt trunk/src/questgen/ trunk/src/questgen/CharacterGoal.lua trunk/src/questgen/CharacterProblem.lua trunk/src/questgen/Quest.lua trunk/src/questgen/QuestGoal.lua trunk/src/questgen/Scene.lua trunk/src/questgen/Story.lua trunk/src/questgen/StoryCharacter.lua Modified: trunk/docs/Quest Generator - Inital Work Spec.txt =================================================================== --- trunk/docs/Quest Generator - Inital Work Spec.txt 2007-12-10 07:34:49 UTC (rev 5) +++ trunk/docs/Quest Generator - Inital Work Spec.txt 2007-12-17 16:32:55 UTC (rev 6) @@ -30,6 +30,8 @@ Memories are of people and events with an associated emotional value. + Relationship list + List of things the character wants to change, with priority (these will most likely become quests if the change item is not very personal; if it is, the char might want to accompany the player but not tell the player why). Eccentricity list - important for giving personality to minor/major characters (IE Indbur of Foundation series disrespect for authority in a totalitarian society) Typical saying list - IE Indbur in Foundation series (Galaxy! My unprintable left foot you won't) and so on @@ -102,9 +104,15 @@ 1. Pick a location for the character. (or location is provided). -2. +2. Pick or provide a relationship for the character. (the character may be created to be the brother of the King, thus that relationship has to be established. +3. Pick the character's gender. +4. Create a purpose for the character. + +5. If needed, create a job for the character (including pre-school kid, homeless, etc.) + + To create a purpose for a character: 1. Needed items: verb list tagged with problems either by profession or general problems. Added: trunk/docs/sample lists/creatable item list.txt =================================================================== Added: trunk/docs/sample lists/problem objects.txt =================================================================== Added: trunk/docs/sample lists/problems.txt =================================================================== Added: trunk/src/questgen/CharacterGoal.lua =================================================================== --- trunk/src/questgen/CharacterGoal.lua (rev 0) +++ trunk/src/questgen/CharacterGoal.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,10 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + + Added: trunk/src/questgen/CharacterProblem.lua =================================================================== --- trunk/src/questgen/CharacterProblem.lua (rev 0) +++ trunk/src/questgen/CharacterProblem.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,10 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + + Added: trunk/src/questgen/Quest.lua =================================================================== --- trunk/src/questgen/Quest.lua (rev 0) +++ trunk/src/questgen/Quest.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,10 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + + Added: trunk/src/questgen/QuestGoal.lua =================================================================== --- trunk/src/questgen/QuestGoal.lua (rev 0) +++ trunk/src/questgen/QuestGoal.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,10 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + + Added: trunk/src/questgen/Scene.lua =================================================================== --- trunk/src/questgen/Scene.lua (rev 0) +++ trunk/src/questgen/Scene.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,10 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + + Added: trunk/src/questgen/Story.lua =================================================================== --- trunk/src/questgen/Story.lua (rev 0) +++ trunk/src/questgen/Story.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,9 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + Added: trunk/src/questgen/StoryCharacter.lua =================================================================== --- trunk/src/questgen/StoryCharacter.lua (rev 0) +++ trunk/src/questgen/StoryCharacter.lua 2007-12-17 16:32:55 UTC (rev 6) @@ -0,0 +1,9 @@ +--[[ + +This is a module for a story. + +--]] + +module(..., package.seeall) + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfb...@us...> - 2007-12-10 07:34:55
|
Revision: 5 http://questgen.svn.sourceforge.net/questgen/?rev=5&view=rev Author: rfboehme Date: 2007-12-09 23:34:49 -0800 (Sun, 09 Dec 2007) Log Message: ----------- Updated initial work spec more - need to flesh out character creation, and put together specifics on what data lists we need to start. Modified Paths: -------------- trunk/docs/Quest Generator - Inital Work Spec.txt Modified: trunk/docs/Quest Generator - Inital Work Spec.txt =================================================================== --- trunk/docs/Quest Generator - Inital Work Spec.txt 2007-12-03 14:56:41 UTC (rev 4) +++ trunk/docs/Quest Generator - Inital Work Spec.txt 2007-12-10 07:34:49 UTC (rev 5) @@ -41,6 +41,11 @@ Goal Target + +CharacterProblem + + + Story Story Goal @@ -79,7 +84,7 @@ To create a quest: -1. Create a character. +1. Create a character or pick one from the world. 2. Create a purpose / problem for the character. @@ -93,6 +98,62 @@ +To create a character: + +1. Pick a location for the character. (or location is provided). + +2. + + +To create a purpose for a character: + +1. Needed items: verb list tagged with problems either by profession or general problems. + +2. Search the list with the character's goal/emotional state, the character's profession and the list of general problems to see which problems could apply to the character. The weight of the items on this list will vary depending on the story type (mileu, character, etc.) + +3. Pick one of these problems. Fill in the problem list. + + +To fill in a problem list: + +1. Get the list of objects for the problem. For each object, search both the current quest and story for objects that could fit the template as well as the general object type list. Weight the current quest/story objects so that they are usually picked over the outside objects. + + One way to do this: + + a. Get the current quest / story objects. + b. Add an 'other' option. + c. Randomly pick an object. If the 'other' object is picked, do a search on useful world objects. + + If we can not find something appropriate that already exists in the world, and we can generate object, generate the object that is the focus of the problem. + +2. For each object created in this manner, specify + + a) If it is unique, and thus cannot be substituted for another object (one Amulet of Yendor vs. any number of sheep spawns) + + b) If it doesn't exist, is it created in the world: + + 1. When it's object is created. + + 2. When the player is within a certain range (good for spawns), or on conversation with an NPC (what NPC and why)? + + +To create a quest for a character: + + 1. Pick a problem that the character has. This problem can, but does not have to, have multiple solutions. + + 2. Decide if the quest will be generic or have a specific desired solution. + + Given the problem: I want the sheep away from my land! I am afraid of their soft pelts! + + An example of a generic quest would be: Return when you've made sure they no longer bother me. The player can take a number of actions to see to this: he could kill the sheep, he could lead them so they eat the next door neighbor's field (thus possibly creating more work), or he could play the Pied Piper and lead the sheep elsewhere. The game mechanics and game goals determine what can happen. + + An example of a specific quest would be: Return when you've killed the sheep! + + 3. Set up the intro scene specifying the character that has the problem as the questgiver. + + 4. Set up a trigger on the end condition to see if it has been changed. If it has been changed, mark the quest completed as successful or unsuccessful. + + Linking a quest with a story: 1. The quest can be created for the story, in which case it is associated with the story. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |