pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
VARDATA strangness!!!
2+ messages / 2 participants
[nested] [flat]

* VARDATA strangness!!!
@ 2001-04-17 22:18 Lonnie Cumberland <lonnie_cumberland@yahoo.com>
  2001-04-18 18:38 ` Re: VARDATA strangness!!! Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Lonnie Cumberland @ 2001-04-17 22:18 UTC (permalink / raw)
  To: pgsql-interfaces

Hello All,

I have been working very hard to try and figure out how to get my existing
functions to work in my Postgresql "C" extensions.

I have run across something strange I think.

My original functions have a prototype like:

string EncryptString(const char *plaintext, const char *passPhrase);
string DecryptString(const char *ciphertext, const char *passPhrase);

and my extencions file is trying to get them in the form:

// These are the DES Crypto functions
text *desencrypt(text *plaintext, text *passPhrase);
text *desdecrypt(text *ciphertext, text *passPhrase);

The problem is that I cannot seem to get the VARDATA and VARSIZE to work
correctly and the VARSIZE always seems to be 4 bytes longer for each of the
input variables.

Does anyone have any ideas?

I tried to work along the copy_text() demo in the funcs.c example but this does
not seem to work.

In anycase, inside my existing functions, I need to be able to work with "char
*plaintext", "char *ciphertext", and "char *passPhrase"

How can I encapsulate my existing functions for this with "text *" inputs.

Cheers :( :( :( :( :( :(

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: VARDATA strangness!!!
  2001-04-17 22:18 VARDATA strangness!!! Lonnie Cumberland <lonnie_cumberland@yahoo.com>
@ 2001-04-18 18:38 ` Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2001-04-18 18:38 UTC (permalink / raw)
  To: Lonnie Cumberland <lonnie_cumberland@yahoo.com>; +Cc: pgsql-interfaces

Lonnie Cumberland writes:

> The problem is that I cannot seem to get the VARDATA and VARSIZE to work
> correctly and the VARSIZE always seems to be 4 bytes longer for each of the
> input variables.

VARSIZE includes the size required to store the VARSIZE, i.e., a 4 byte
integer.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-04-18 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-17 22:18 VARDATA strangness!!! Lonnie Cumberland <lonnie_cumberland@yahoo.com>
2001-04-18 18:38 ` Peter Eisentraut <peter_e@gmx.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox