Greg Obleshchuk | 1 Apr 11:44 2004

[sqlite] va_list

Hi ,
Can anyone tell me if you can manually create a va_list object.  I have in my wrapper now the sqlite_vmprintf
function but as .NET doesn't support the ... as a parameter I had to use a [ParamArray] .  Currently I am
testing the number of parameters passed and calling sqlite_vmprintf different ways.  If I could create a
va_list and just pass the object it would be a one line call.

thanks 
Greg O
Christian Smith | 1 Apr 12:42 2004

Re: [sqlite] va_list

On Thu, 1 Apr 2004, Greg Obleshchuk wrote:

>Hi , Can anyone tell me if you can manually create a va_list object.  I
>have in my wrapper now the sqlite_vmprintf function but as .NET doesn't
>support the ... as a parameter I had to use a [ParamArray] .  Currently I
>am testing the number of parameters passed and calling sqlite_vmprintf
>different ways.  If I could create a va_list and just pass the object it
>would be a one line call.

va_list is an opaque type as far as the C standard is concerned.

How it is implemented is a platform detail of the compiler, and should
not be messed with.

Looking at the gcc 3.3 stdarg.h on my Linux box, va_list isn't even a
structure, but a typedef for an internal __gnuc_va_list type, which is
manipulated by internal gcc functions.

In other words, even if you think you know how a va_list is implemented on
your platform, don't go there. A world of pain awaits.

Instead, look at what you're using the va_list for. C generally needs it
because it's string handling is poor and *printf is the easiest way to
build strings from templates. By .NET I presume you're using C#, which
should have proper strings and not need the *printf hacks used in C.

>
>thanks
>Greg O

(Continue reading)

Gregory Letellier | 1 Apr 13:00 2004
Picon

[sqlite] single quote protection

hello,

i've many strings value to insert in a varchar column,
but this strings contains character : '

how to protect it ? 

thx for your help !

(Continue reading)

Greg Obleshchuk | 1 Apr 13:47 2004

Re: [sqlite] va_list

Hi Chris,
Thanks for your reply.  
I do have a different way of handling it in C# but I am passing the call on to the sqlite_vmprintf function (in
printf.c and that accepts a va_list)
The way around it that I use is having a switch statement and if the use passes one parameter the I calls
sqlite_vmprintf with one parame , if two it calls it with two and so on.  If I could build a va_list then I would
built it and just call sqlite_vmprintf once.

anyway thanks
Greg
  ----- Original Message ----- 
  From: Christian Smith 
  To: Greg Obleshchuk 
  Cc: sqlite-users@... 
  Sent: Thursday, April 01, 2004 8:42 PM
  Subject: Re: [sqlite] va_list

  On Thu, 1 Apr 2004, Greg Obleshchuk wrote:

  >Hi , Can anyone tell me if you can manually create a va_list object.  I
  >have in my wrapper now the sqlite_vmprintf function but as .NET doesn't
  >support the ... as a parameter I had to use a [ParamArray] .  Currently I
  >am testing the number of parameters passed and calling sqlite_vmprintf
  >different ways.  If I could create a va_list and just pass the object it
  >would be a one line call.

  va_list is an opaque type as far as the C standard is concerned.

  How it is implemented is a platform detail of the compiler, and should
  not be messed with.
(Continue reading)

Tito Ciuro | 1 Apr 14:24 2004
Picon

Re: [sqlite] single quote protection

Hello Gregory,

http://www.mail-archive.com/sqlite-users-CzDROfG0BjIdnm+yROfE0A <at> public.gmane.org/msg01031.html

Advice: use the archives. There are lots and lots of info.

Regards,

-- Tito

On 1 abr 2004, at 13:03, Gregory Letellier wrote:

> hello,
>  
> i've many strings value to insert in a varchar column,
> but this strings contains character : '
>  
> how to protect it ?
>   
> thx for your help !
>  
>  
>
> ________________________________________________________________
> <image.tiff>  IncrediMail - La messagerie électronique a enfin évolué 
> - Cliquer ici
Gregory Letellier | 1 Apr 14:28 2004
Picon

[sqlite] Réf. : Re: [sqlite] single quote protection

 thx for your help !!!!

 
-------Message original-------
 
De : Tito Ciuro
Date : 04/01/04 14:24:31
A : Gregory Letellier
Cc : sqlite-users@...
Sujet : Re: [sqlite] single quote protection
 
Hello Gregory,
 
http://www.mail-archive.com/sqlite-users-CzDROfG0BjIdnm+yROfE0A <at> public.gmane.org/msg01031.html

 
Advice: use the archives. There are lots and lots of info.
 
Regards,
 
-- Tito
 
On 1 abr 2004, at 13:03, Gregory Letellier wrote:
 
> hello,
>  
> i've many strings value to insert in a varchar column,
> but this strings contains character : '
>  
> how to protect it ?
>   
(Continue reading)

eno | 1 Apr 16:28 2004

Re: [sqlite] va_list

Greg Obleshchuk wrote:

> Hi Chris,
> Thanks for your reply.  
> I do have a different way of handling it in C# but I am passing the call on to the sqlite_vmprintf function (in
printf.c and that accepts a va_list)
> The way around it that I use is having a switch statement and if the use passes one parameter the I calls
sqlite_vmprintf with one parame , if two it calls it with two and so on.  If I could build a va_list then I would
built it and just call sqlite_vmprintf once.

Hi Greg,

it *might* work building up a (CPU-)stack-like structure holding all the 
parameters, which, of course should be only int's and const char*. To 
outline this, have a look at this example, which is C++:

struct value {
	enum Type { Int, String } type;
	int i;
	std::string s;
};

typedef vector<value> Values;

void run_vprintf(const char* fmt, const Values& v)
{
	//
	// The size of a single element
	unsigned el = max(sizeof(int), sizeof(char*);

(Continue reading)

eno | 1 Apr 16:30 2004

Re: [sqlite] va_list

right after hitting send I found a line missing and some typo.
>     //
>     // The stack, as we are used to it, grows downwards.
>     // If it wouldn't we had to use begin()/end() here.
>     Values::const_reverse_iterator it = v.rbegin();
>     Values::const_reverse_iterator end = v.rend();
> 
>     while(it != end) {
>         switch(it->type) {
>         case value::Int:
>             *(int*)d = it->i;
>             break;
>         case value::String:
>             *(char*)d = it->s.c_str();
>             break;
>         }
>         ++it;
>     }

should read

      //
      // The stack, as we are used to it, grows downwards.
      // If it wouldn't we had to use begin()/end() here.
      Values::const_reverse_iterator it = v.rbegin();
      Values::const_reverse_iterator end = v.rend();
      char* d = p;

      while(it != end) {
          switch(it->type) {
(Continue reading)

Eli Wheaton | 1 Apr 17:46 2004

[sqlite] Using sqlite with C++Builder6

Hi All,

I'm having a problem trying to get SQLite to work with a C++Builder6
project.
Does anyone have any advice on how to do this?

OS: Windows XP

---------------------------------------------------------------------
To unsubscribe, e-mail: sqlite-users-unsubscribe@...
For additional commands, e-mail: sqlite-users-help@...

Drew, Stephen | 1 Apr 17:48 2004

RE: [sqlite] Using sqlite with C++Builder6

I have it working under Windows 2000 using BCB 6.

-----Original Message-----
From: Eli Wheaton [mailto:ewheaton@...]
Sent: Thursday, April 01, 2004 4:47 PM
To: sqlite-users@...
Subject: [sqlite] Using sqlite with C++Builder6

Hi All,

I'm having a problem trying to get SQLite to work with a C++Builder6
project.
Does anyone have any advice on how to do this?

OS: Windows XP

---------------------------------------------------------------------
To unsubscribe, e-mail: sqlite-users-unsubscribe@...
For additional commands, e-mail: sqlite-users-help@...

---------------------------------------------------------------------
To unsubscribe, e-mail: sqlite-users-unsubscribe@...
For additional commands, e-mail: sqlite-users-help@...

hello,
 
i've many strings value to insert in a varchar column,
but this strings contains character : '
 
how to protect it ?
 
thx for your help !
 
 
Mon Tue Wed Thu Fri Sat Sun
   1234
567891011
12131415161718
19202122232425
2627282930  
Language
Options
Current view: Threads only / Showing only 20 lines / Not hiding cited text.
Change to All messages, whole messages, or hide cited text.

Post a message
NNTP Newsgroup
Classic Gmane web interface
XML RSS Feed
List Information

About Gmane
Recent entries
Archives
 
487
 
606
 
598
 
519
 
372
 
705
 
480
 
642
 
522
 
586
 
563
 
587
 
597
 
631
 
537
 
455
 
545
 
520
 
709
 
613
 
374
 
538
 
817
 
703
 
742
 
843
 
842
 
966
 
473
 
748
 
838
 
822
 
732
 
650
 
874
 
749
 
593
 
640
 
833
 
772
 
828
 
690
 
687
 
594
 
637
 
839
 
763
 
737
 
600
 
806
 
508
 
549
 
780
 
857
 
1153
 
1082
 
722
 
888
 
917
 
855
 
695
 
885
 
728
 
696
 
451
 
736
 
710
 
697
 
752
 
766
 
837
 
722
 
896
 
828
 
755
 
787
 
728
 
902
 
704
 
532
 
926
 
717
 
772
 
629
 
829
 
1059
 
988
 
815
 
871
 
737
 
565
 
607
 
669
 
812
 
789
 
927
 
593
 
855
 
578
 
643
 
428
 
565
 
583
 
696
 
538
 
532
 
506
 
507
 
552
 
562
 
662
 
622
 
427
 
341
 
494
 
499
 
475
 
280
 
425
 
381
 
340
 
381
 
297
 
329
 
230
 
294
 
448
 
391
 
440
 
463
 
422
 
299
 
202
 
257
 
274
 
246
 
153
 
196
 
121
 
1
Design
Your Own Design
Paste the URL of your CSS below.
Download CSS template