Re: [Registry] change
Brought to you by:
aviram
|
From: Markus R. <mai...@gm...> - 2004-10-18 19:38:49
|
Am Montag, 18. Oktober 2004 18:30 schrieb Jens Andersen:
> > 954 if (!key || !keyIsInitialized(key))
> > (gdb)
> > 957 if (!key->data) {
> > (gdb)
> > 958 errno=KDB_RET_NODATA;
> > (gdb)
> > 959 return 0;
> >
> > and to find this problem i would have to debug complete elektra!
>
> I assume you get this error from keyGetBinary?
yes this code is from debugging keyGetBinary
> Running your code (with some minor modifications) gives me an error in
> kdbGetKey..However the error is probably deeper down!
Yes, i am afraid keyGetBinary does not work in any way :-)
> Specifically in the unencode function. It seems that the binary data gets
> written fine to file(data fits at least), but something goes wrong when
> reading in.
Yes, thats the point. I don't really understand why it is encoded to
hex-values, but ok. The main reason to use binary, is to have it *not*
encoded.
> When it's read back in and unencode is called the data passed there is
> simply 190 (and seemingly some garbage data as well). This could possibly
> be the problem?
Can you post me the code how to read it to get any value back?
> Tbh, i'm not sure if you can even just convert it back and set it the way
> the code does? (from further investigation it seems you can't..It gives
> some really weird results)
Maybe best will be to cut off the encoding for binary values. It does not make
sense anyway and does not work. Or can you repair that avi?
> > Can you give me an example where getting binary Data works?
>
> binary data works fine with strings :) (i.e. saving a char * to disk as
> binary and reading it again). Dunno about other data types, haven't tried.
> Int currently doesn't work at least :)
Yes, but i don't want that, because i want it fast and directly. Of course i
know that it is possible to use atoi or strtod with strings. But this does
not solve the problem with keyGetBinary. I dont think we want buggy functions
in the api :-)
mfg Markus
|