[sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread Martin Pfeifle
Dear all, in an upcoming project, it is required to store all integer values as little endian instead of big endian (don't ask why). Nevertheless, I would like to use SQLite in that project. What do we have to change in the sqlite library, if we store the integers as little endian. I came across

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread drh
Martin Pfeifle [EMAIL PROTECTED] wrote: Dear all, in an upcoming project, it is required to store all integer values as little endian instead of big endian (don't ask why). Nevertheless, I would like to use SQLite in that project. What do we have to change in the sqlite library, if we

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread drh
Martin Pfeifle [EMAIL PROTECTED] wrote: in an upcoming project, it is required to store all integer values as little endian instead of big endian... Does that mean you are not allowed to use TCP/IP which stores everything big-endian? ;-) -- D. Richard Hipp [EMAIL PROTECTED]

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread Jakub Ladman
I think there is no need to change endianess. Sqlite is shadowing out this and similar low level aspects. If you need to get data from database and use it in something what needs it in other endianess, you may use something like this. int change_endianess(unsigned char *data, int length) {

Re: [sqlite] How can I change big-endian to little-endian in the database file

2007-04-03 Thread John Stanton
A very efficient way to re-arrange the byte ordering is to use a free union. No function calls involved or tests. Jakub Ladman wrote: I think there is no need to change endianess. Sqlite is shadowing out this and similar low level aspects. If you need to get data from database and use it in