1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00
Commit Graph

20 Commits

Author SHA1 Message Date
Martin Pool
8cbaea2afa Rename unpack_* functions to be consistent
Decode CP850 strings when unpacking

Add variable giving default encoding name
-
Martin Pool
e62baf3a76 Rename pytdbpack_unpack -> pytdbunpack -
Martin Pool
7863c948b7 Just reorder functions to put related ones together -
Martin Pool
001779dffd Remove dead code for packing buffers which has now been reimplemented. -
Martin Pool
62ca27d140 Remove dead code for packing buffers which has now been reimplemented. -
Martin Pool
2480d385db Rewrite all the packing stuff so that it converts 'f' strings to CP850
on encoding.  (Tough luck if your Samba codepage is not 850.)  It's
much cleaner and possibly more efficient now too: just build one big
list of strings, then zip it up at the end.

Still need to do this for unpacking.
-
Martin Pool
dd73568f97 pytdbpack_unpack: Clean up, and correct the handling of '$'. -
Martin Pool
248067931a pytdbpack_pack_data: Allow first argument to be any kind of Number,
not just an Integer.  Coerce appropriately.
-
Martin Pool
db67c5f7e5 pytdbpack_pack_data: If the first argument to a 'B' code is not an
Integer, raise an error rather than just returning Null, which breaks
the interpreter.
-
Martin Pool
49a0ba46e6 pytdbpack_pack_data: Oops, since B is separately encoded as buffer and
length we need separate counters traversing the format and value
sequences to pack them.
-
Martin Pool
d72b144e03 pytdbpack_unpack: Handle unpacking Buffers into (LEN, DATA): form list
by appending, rather than preallocating.
-
Martin Pool
2085595565 pytdbpack_pack_data: Allow 'd' and 'w' formats to take either Integer
or Long arguments.
-
Martin Pool
2593e15883 Make sure uint32 unpacking is unsigned, and generates a Python long so
that it can represent all the unsigned values
-
Martin Pool
30525aee33 pytdbpack_calc_reqd_len: Correct calculation of packed length of
string types
-
Martin Pool
20d88a7d1e Change to representing buffers ('B') as (LEN, STRING) in Python,
rather than as just a string.  Makes the code more messy, but needed
for compatibility with existing PSA Python code which seems to be too
knotty to separate out.
-
Martin Pool
0c1cfe5598 pytdbpack_calc_reqd_len: It's no longer an error to supply more data
values than are consumed.
-
Martin Pool
21e4186642 Doc -
Martin Pool
1b681bd524 pytdbpack_calc_reqd_len: Make exception be thrown correctly when a
non-string is used with a string format code.  (It was being generated
but not thrown.)

Also call checked versions of some functions rather than FAST_*
versions.
-
Martin Pool
6139ab3cbc Give better error messages for TypeError, which will arise if e.g. you
try to pack an Int using a string tdbpack format.
-
Martin Pool
1f7ed8bb86 Import my code to do reasonably fast tdbpack/unpack from Python -