Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-17 Thread Tiago Rodrigues
If that is not an option, then you should probably create a function taking
the HSTORE key and the sought key and returning the corresponding value or
NULL.


On Mon, Mar 17, 2014 at 11:41 PM, Tiago Rodrigues <wtrm...@gmail.com> wrote:

> Generally, I'd suggest you take these HSTORE key-value-pairs types and
> recast them as a separate table (say, HSTORE (STORE integer primary key,
> KEY text, VALUE text) ) and then query (SELECT VALUE FROM {TABLE1} JOIN
> HSTORE ON HSTORE.STORE = {TABLE1}.{HSTORECOLUMN} WHERE VALUE = 'some_key';)
>
>
> On Mon, Mar 17, 2014 at 10:46 PM, Stefan Keller <sfkel...@gmail.com>wrote:
>
>> Hi,
>>
>> I have a column which contains a string structure taken from the
>> PostgreSQL HSTORE key-value-pairs type. This is an example of one
>> column value:
>>
>> "operator"=>"police","name"=>"Zurich","some_key"=>"some_value"
>>
>> Any suggestions on how to query this most efficiently (like [select
>> value from "some_key"])?
>>
>> Yours, Stefan
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> In those days, in those distant days, in those nights, in those remote
> nights, in those years, in those distant years...
>   - Gilgamesh, Enkidu and the Underworld
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How to query key-value-pairs similar to PostgreSQL HSTORE type?

2014-03-17 Thread Tiago Rodrigues
Generally, I'd suggest you take these HSTORE key-value-pairs types and
recast them as a separate table (say, HSTORE (STORE integer primary key,
KEY text, VALUE text) ) and then query (SELECT VALUE FROM {TABLE1} JOIN
HSTORE ON HSTORE.STORE = {TABLE1}.{HSTORECOLUMN} WHERE VALUE = 'some_key';)


On Mon, Mar 17, 2014 at 10:46 PM, Stefan Keller  wrote:

> Hi,
>
> I have a column which contains a string structure taken from the
> PostgreSQL HSTORE key-value-pairs type. This is an example of one
> column value:
>
> "operator"=>"police","name"=>"Zurich","some_key"=>"some_value"
>
> Any suggestions on how to query this most efficiently (like [select
> value from "some_key"])?
>
> Yours, Stefan
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Insert multiple values as an economy of coding time and quicker upload process ?

2014-01-14 Thread Tiago Rodrigues
INSERT INTO t1 SELECT 1 UNION SELECT 2 UNION (...) SELECT ;

It works out of the box on any DBMS you care to name, and of course in
SQLite, too.  It is ever so slightly verbose, but better than the
alternative of executing  INSERT INTO t1 VALUES(###);

Cheers,

  -Tiago


On Mon, Jan 13, 2014 at 3:21 PM, big stone  wrote:

> Hello,
>
> I read the source code of sqlite and I find a lot of :
>
>
> CREATE TABLE t1(x INTEGER);
> INSERT INTO t1 VALUES(1);INSERT INTO t1 VALUES(2);
> 
>
> Wouldn't it be both an economy of coding time and a more quick upload
> process to allow Multiple inserts SYNTAX ?
>
> like :
> INSERT INTO t1 VALUES(1),(2),  ();
>
> I'm not 100% certain it's in SQL standard, but the syntax seems ok for
> SQL Server , Oracle , and POSTGRESQL at least.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] vbscript and sqlltie

2013-10-28 Thread Tiago Rodrigues
Hi, Joe,

Now, it's been years since I've touched VBScript, but I think the syntax of
attributing the connection string to the Open method is wrong.  You should
probably use

objConn.Open "Provider=System.Data.SQLite; Data
Source=C:\DATA\SQLLite\mydb.db3"

or (better)

objConn.Open("Provider=System.Data.SQLite; Data
Source=C:\DATA\SQLLite\mydb.db3")

If that doesn't work, try doubling the backslashes
("C:\\DATA\\SQLLite\\mydb.db3") in case the ADO.NET connection is reparsing
the connection string allowing C-style escapes.

Let me know if that helps,

  -Tiago


On Sun, Oct 27, 2013 at 5:41 AM, Joe Fuller wrote:

> Hi,
>
> Hope someone can help.
>
> I’m trying t access sqllite database via vbscript.
>
> I don’t want to use odbc just ado.net.
>
>
>
> I’ve downloaded the and installed ado.net driver for .net 3.5 from this
> site  
> http://system.data.sqlite.org
>
> Both 64 and 32 bit versions but I cannot get it to work in my script.
>
>
>
> This is the sort of thing I’ve tried.
>
>
>
> Set objConn = CreateObject("ADODB.Connection")
> objConn.Open = "Provider=System.Data.SQLite; Data
> Source=C:\DATA\SQLLite\mydb.db3"
>
>
>
> I get the error “Provider cannot be found. It may not be properly
> installed”
>
> How can I confirm the driver is properly installed?
> And
>
> Is my syntax correct?
>
>
>
> Can anyone help?
>
> Suggest other drivers? Anything?
> Thanks.
>
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] curious: Why no "shared library" or DLL?

2013-08-30 Thread Tiago Rodrigues
On Fri, Aug 30, 2013 at 1:37 PM, Simon Slavin  wrote:

>
> On 30 Aug 2013, at 4:46pm, Jay A. Kreibich  wrote:
>
> > On Fri, Aug 30, 2013 at 03:41:18PM +0100, Simon Slavin scratched on the
> wall:
> >
> >> The arguments against DLLs are not the normal arguments you see,
> >> they're governed by an unusual combination of four characteristics of
> SQLite:
> >>
> >> A) SQLite is very much liked, and a huge number of programs use it.
> >> B) SQLite is tiny.  You don't waste much disk space by having lots of
> copies.
> >> C) There are frequent version updates to SQLite which introduce new
> >>   facilities.
> >> D) SQLite is detailed and complicated, so updates sometimes break
> >>   assumptions made by programmers.
> >
> >  I'm not sure that last one is fair.  Generally, the SQLite team makes
> >  a huge effort to avoid breaking backwards compatibility, both documented
> >  and assumed.  There are a whole list of known bugs that will never get
> >  fixed because they might break existing applications.  While there
> >  are some changes to the query optimizer that sometimes do odd things,
> >  overall this is a pretty poor reason.
>
> While I take your point there have been numerous examples in the last year
> of what I would call 'assumptions made by programmers' which aren't obvious
> bugs.  For example the user who had a SELECT where a calculation was named
> the same as a column which actually existed in the table, and one version
> of SQLite did one thing, and another did the other.  It was only possible
> to identify one of them as a bug by detailed examination of a late version
> of the SQL standard.  Without that they were both arguably acceptable SQL.
>
> >  For me, the biggest issue is A and B, combined with the fact that
> >  many applications that very heavily use and integrate SQLite often
> >  have a custom compile with specific extensions, default values, and
> >  features turned on or off.
>
> That's one I missed.  Yes: very many compilation options, with none
> obviously better than others.  Therefore different people want different
> object code.
>
> For me the biggest argument is that the SQLite dev team go to the effort
> of making amalgamation source code available, which I think is wonderful.
>  But I wasn't brought up in the world of Windows programming where you
> expect everything to be a DLL, and I can understand someone who was
> wondering why anyone ever did anything but use the a 'standard' DLL.
>
>
It's not that "everyone in Windows programming expects everything to be a
DLL"; this is an overgeneralisation.  After all, Java isn't exactly
Windows-only code and we're not dealing with Win32, but with IBM zOS.
However, think a bit on the problem of how you could compile in a native
code object file into a program which runs inside a virtual machine.

This is a problem with Python, Lua and Ruby, as well, although in Python
and Lua's case we could create a C executable hosting the Python or Lua VM
inside it and expose the SQLite API to it via extension methods.  I don't
know how embeddable Ruby is.

At any rate, one cannot generally embed a JVM or CLR into a C program, so
you're left with one mechanism, which is the very Unix-y
dlopen()/dlclose()/dlsym() interface, or its Windows analogue,
LoadLibrary()/FreeLibrary()/GetProcAddress()...


> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Newbie startup problems

2013-06-22 Thread Tiago Rodrigues
Wenda,

Clearly, in spite of you affirming having included the SQLite assembly in
your references, the IDE isn't finding the SQLite package.  If you say it's
not a problem of "using ;" directive, then the reference must be pointing
to a bad location (in this case it would get the standard
exclamation-yellow-triangle when you look at it in Solution Explorer).
Without more information on the specifics of your environment, though, I
cannot be sure.

Hope that helps,

  -Tiago


On Fri, Jun 21, 2013 at 5:42 PM, Wenda Stephens wrote:

> I am trying to learn SQLite due to attempting to code my first Windows 8
> app, which seems to use no other database but SQLite.. Also due to W8 apps
> needing to use async in a somewhat new style of async, the only tutorial I
> found on it was from Channel 9..
>
> http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Using-SQLite-in-Windows
> -Store-Apps ..  Which brought in SQLite through tools/extensions &
> updates..
> So SQLite Windows Runtime and C++ Runtime Package are in my Reference..
> Then he had me also add in some Linq handling  with a Nuget package from
> tools/Library Package Manager and pulled down SQLite.net.
>
>
>
> So first few lines of code, and anything with the word SQLite  blows up..
> if I opp. Click on the error there is not help to find a missing using
> statement, and on one of the pages in the video I can see the using
> statements and nothing seems extra from normal default..
>
>
>
> But with the two following Statements the word SQLite.  Is not liked by the
> code.. What am I missing??
>
>
>
> using (var db = new SQLite.SQLiteConnection(dBPath))
>
> {
>
>  // Create the tables if they don't exist
>
>db.CreateTable();
>
> }
>
>
>
> class AdKills
>
> {
>
> [SQLite.PrimaryKey]
>
> public Int64 KillKey { get; set; }
>
> public Int64 AdNumber { get; set; }
>
> public Int64 UnassignedAdNumber { get; set; }
>
> }
>
>
>
>
>
> Thanks in advance
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Implementing "Save As..." functionality for Application File Format usecase

2013-04-03 Thread Tiago Rodrigues
Hello all,

I'm writing a small simulation app and for it I would like to use SQLite3
as an application file format, as suggested by the "Appropriate uses for
SQLite" page in sqlite.org.  More specifically, the page suggests calling
BEGIN TRANSACTION when opening a file and calling COMMIT when saving it
again, or ROLLBACK if closing it without saving.  Simple enough, up until
the point where I want to implement a "Save As..." menu option, where the
current state of the application is saved to a new file (new database) with
the changes, while the changes in the current file are rolled back.

For that, the simplest idea would be to use the online backup family of
functions, calling sqlite3_backup_init() and sqlite3_backup_step() on the
database, calling COMMIT on the backup and ROLLBACK on the original.
Naturally, that doesn't work, as you can't back up a database in the middle
of a transaction -- sqlite3_backup_step() returns SQLITE_BUSY.

That being said, has anyone on the list encountered (and hopefully solved)
this particular problem?  This probably means I have to scrap the idea of
holding a transaction through the editing of the file, but then should I
copy the database to a memory-based db?  Any particular tips or caveats?

I appreciate the attention,

  -Tiago

-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] (Lemon) (Patch) adding a -f option to Lemon to emit function prototypes

2013-01-09 Thread Tiago Rodrigues
I see; well, that's unfortunate.  At any rate, parsing lempar.c will
probably be much more complex than the code I have now, which solves a
simple (but common) case.  Maybe I'll look into parsing lempar.c, but since
this solves my use case, I probably won't be in a hurry to do it.  I
apologise to everyone this doesn't help, then.

Cheers,

  -Tiago


On Mon, Jan 7, 2013 at 9:13 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Mon, Jan 7, 2013 at 4:18 PM, Tiago Rodrigues <wtrm...@gmail.com> wrote:
>
> > Oops, Dominique alerted me to the fact that the patch I included was
> > stripped by the listserver...  I'm including it inline, then.
> >
>
>
> This patch does not work in the general case.  I don't doubt that it works
> for your use case, but in general it does not.  The reason:  The function
> prototypes depend on the "lempar.c" template file.  Some applications (ex:
> SQLite) change the lempar.c parser template in ways that could change the
> function signatures.  (The function signatures for SQLite are unchanged,
> but that doesn't exclude the possibility that they might in the future.)
>
> For this to really work in general, I suppose you would have to somehow
> extract the function signatures from the lempar.c template file.  Or maybe
> have a separate lempar.h template that contains the header.  Or something.
>
>
>
> >
> > (Begin patch)
> >
> > --- lemon.c2013-01-04 20:39:20 +
> > +++ lemon-new.c2013-01-04 23:09:59 +
> > @@ -109,7 +109,7 @@
> >  void Reprint(struct lemon *);
> >  void ReportOutput(struct lemon *);
> >  void ReportTable(struct lemon *, int);
> > -void ReportHeader(struct lemon *);
> > +void ReportHeader(struct lemon *, int);
> >  void CompressTables(struct lemon *);
> >  void ResortStates(struct lemon *);
> >
> > @@ -1393,11 +1393,13 @@
> >static int mhflag = 0;
> >static int nolinenosflag = 0;
> >static int noResort = 0;
> > +  static int fpflag = 0;
> >static struct s_options options[] = {
> >  {OPT_FLAG, "b", (char*), "Print only the basis in
> report."},
> >  {OPT_FLAG, "c", (char*), "Don't compress the action
> table."},
> >  {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
> >  {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."},
> > +{OPT_FLAG, "f", (char*), "Generate function prototypes in
> > header."},
> >  {OPT_FLAG, "g", (char*), "Print grammar without actions."},
> >  {OPT_FLAG, "m", (char*), "Output a makeheaders compatible
> > file."},
> >  {OPT_FLAG, "l", (char*), "Do not print #line
> > statements."},
> > @@ -1502,7 +1504,7 @@
> >  /* Produce a header file for use by the scanner.  (This step is
> >  ** omitted if the "-m" option is used because makeheaders will
> >  ** generate the file for us.) */
> > -if( !mhflag ) ReportHeader();
> > +if( !mhflag ) ReportHeader(, fpflag);
> >}
> >if( statistics ){
> >  printf("Parser statistics: %d terminals, %d nonterminals, %d
> rules\n",
> > @@ -4009,16 +4011,20 @@
> >  }
> >
> >  /* Generate a header file for the parser */
> > -void ReportHeader(struct lemon *lemp)
> > +void ReportHeader(struct lemon *lemp, int fpflag)
> >  {
> >FILE *out, *in;
> > +  const char *name;
> >const char *prefix;
> >char line[LINESIZE];
> >char pattern[LINESIZE];
> >int i;
> > +  int protok = 1;
> >
> >if( lemp->tokenprefix ) prefix = lemp->tokenprefix;
> >elseprefix = "";
> > +  if( lemp->name ) name = lemp->name;
> > +  else name = "Parse";
> >in = file_open(lemp,".h","rb");
> >if( in ){
> >  int nextChar;
> > @@ -4026,9 +4032,24 @@
> >sprintf(pattern,"#define %s%-30s
> > %2d\n",prefix,lemp->symbols[i]->name,i);
> >if( strcmp(line,pattern) ) break;
> >  }
> > +if( fpflag ){
> > +sprintf(pattern,"void *%sAlloc(void *(*)(size_t));\n",name);
> > +if( !fgets(line,LINESIZE,in) || strcmp(line,pattern) ){ protok =
> > 0; goto after; }
> > +
> > +if( lemp->arg ){
> > +sprintf(pattern,"void %s(void
> > *,int,%s,%s);\n",name,lemp->tokentype,lemp->arg);
>

Re: [sqlite] (Lemon) (Patch) adding a -f option to Lemon to emit function prototypes

2013-01-07 Thread Tiago Rodrigues
Oops, Dominique alerted me to the fact that the patch I included was
stripped by the listserver...  I'm including it inline, then.

(Begin patch)

--- lemon.c2013-01-04 20:39:20 +
+++ lemon-new.c2013-01-04 23:09:59 +
@@ -109,7 +109,7 @@
 void Reprint(struct lemon *);
 void ReportOutput(struct lemon *);
 void ReportTable(struct lemon *, int);
-void ReportHeader(struct lemon *);
+void ReportHeader(struct lemon *, int);
 void CompressTables(struct lemon *);
 void ResortStates(struct lemon *);

@@ -1393,11 +1393,13 @@
   static int mhflag = 0;
   static int nolinenosflag = 0;
   static int noResort = 0;
+  static int fpflag = 0;
   static struct s_options options[] = {
 {OPT_FLAG, "b", (char*), "Print only the basis in report."},
 {OPT_FLAG, "c", (char*), "Don't compress the action table."},
 {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."},
 {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."},
+{OPT_FLAG, "f", (char*), "Generate function prototypes in
header."},
 {OPT_FLAG, "g", (char*), "Print grammar without actions."},
 {OPT_FLAG, "m", (char*), "Output a makeheaders compatible
file."},
 {OPT_FLAG, "l", (char*), "Do not print #line
statements."},
@@ -1502,7 +1504,7 @@
 /* Produce a header file for use by the scanner.  (This step is
 ** omitted if the "-m" option is used because makeheaders will
 ** generate the file for us.) */
-if( !mhflag ) ReportHeader();
+if( !mhflag ) ReportHeader(, fpflag);
   }
   if( statistics ){
 printf("Parser statistics: %d terminals, %d nonterminals, %d rules\n",
@@ -4009,16 +4011,20 @@
 }

 /* Generate a header file for the parser */
-void ReportHeader(struct lemon *lemp)
+void ReportHeader(struct lemon *lemp, int fpflag)
 {
   FILE *out, *in;
+  const char *name;
   const char *prefix;
   char line[LINESIZE];
   char pattern[LINESIZE];
   int i;
+  int protok = 1;

   if( lemp->tokenprefix ) prefix = lemp->tokenprefix;
   elseprefix = "";
+  if( lemp->name ) name = lemp->name;
+  else name = "Parse";
   in = file_open(lemp,".h","rb");
   if( in ){
 int nextChar;
@@ -4026,9 +4032,24 @@
   sprintf(pattern,"#define %s%-30s
%2d\n",prefix,lemp->symbols[i]->name,i);
   if( strcmp(line,pattern) ) break;
 }
+if( fpflag ){
+sprintf(pattern,"void *%sAlloc(void *(*)(size_t));\n",name);
+if( !fgets(line,LINESIZE,in) || strcmp(line,pattern) ){ protok =
0; goto after; }
+
+if( lemp->arg ){
+sprintf(pattern,"void %s(void
*,int,%s,%s);\n",name,lemp->tokentype,lemp->arg);
+}else{
+sprintf(pattern,"void %s(void
*,int,%s);\n",name,lemp->tokentype);
+}
+if( !fgets(line,LINESIZE,in) || strcmp(line,pattern) ){ protok =
0; goto after; }
+
+sprintf(pattern,"void *%sFree(void *,void (*)(void *));\n",name);
+if( !fgets(line,LINESIZE,in) || strcmp(line,pattern) ){ protok =
0; goto after; }
+}
+after:
 nextChar = fgetc(in);
 fclose(in);
-if( i==lemp->nterminal && nextChar==EOF ){
+if( i==lemp->nterminal && protok && nextChar==EOF ){
   /* No change in the file.  Don't rewrite it. */
   return;
 }
@@ -4038,6 +4059,16 @@
 for(i=1; interminal; i++){
   fprintf(out,"#define %s%-30s %2d\n",prefix,lemp->symbols[i]->name,i);
 }
+if( fpflag ){
+/* emit function prototypes */
+fprintf(out,"void *%sAlloc(void *(*)(size_t));\n",name);
+if( lemp->arg ){
+fprintf(out,"void %s(void
*,int,%s,%s);\n",name,lemp->tokentype,lemp->arg);
+    }else{
+fprintf(out,"void %s(void *,int,%s);\n",name,lemp->tokentype);
+}
+fprintf(out,"void *%sFree(void *,void (*)(void *));\n",name);
+}
 fclose(out);
   }
   return;

(End patch)

Thanks,

  -Tiago


On Mon, Jan 7, 2013 at 6:15 AM, Dominique Devienne <ddevie...@gmail.com>wrote:

> On Sat, Jan 5, 2013 at 6:22 PM, Tiago Rodrigues <wtrm...@gmail.com> wrote:
> > [...]
> > This patch works against the current version of lemon.c, as linked to by
> > the Lemon page.  This is probably not correct, as the file is amalgamated
> > from other sources, but still might be useful to somebody.
>
> Hi Tiago. Looks like the patch was stripped by the mailing list.
> Perhaps you should include it inline to your message. Thanks, --DD
>



-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] (Lemon) (Patch) adding a -f option to Lemon to emit function prototypes

2013-01-05 Thread Tiago Rodrigues
Hello, all,

First, forgive me if this is the wrong medium for submitting this, but I'm
rather new at this patch submission business.  Anyway, I was using Lemon to
generate a few parsers for a program I'm writing (which uses SQLite, too,
for storage), and I noticed that the files I used to call the parser were
giving me a strange "Pointer made from integer without a cast" on
ParseAlloc(), which is strange, since ParseAlloc() returns a void *.  It
took me a while to figure out that ParseAlloc(), ParseFree() and Parse()
weren't actually declared anywhere, so the compiler was assuming they
received no parameters and returned int.  Since I have more than one parser
to work with, I decided to have lemon emit the function prototypes on the
header file upon a new (-f) flag.  Then I decided that I might as well
submit this back to the community and let it decide whether the inclusion
is useful or not.

This patch works against the current version of lemon.c, as linked to by
the Lemon page.  This is probably not correct, as the file is amalgamated
from other sources, but still might be useful to somebody.

Thanks for reading,

  -Tiago

-- 
In those days, in those distant days, in those nights, in those remote
nights, in those years, in those distant years...
  - Gilgamesh, Enkidu and the Underworld
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users