[libgetdata] 01/01: New version 0.9.4
Alastair McKinstry
mckinstry at moszumanska.debian.org
Wed May 3 10:35:12 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to tag upstream/0.9.4
in repository libgetdata.
commit b388117136b18a97f9b1274cd64adc2bcadb7449
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Wed Sep 14 23:37:39 2016 +0100
New version 0.9.4
---
ChangeLog | 37 +++++++
NEWS | 51 ++++++++--
bindings/matlab/getdata_constants.m | 2 +-
bindings/python/gdpy_intern.h | 2 +-
bindings/python/pyentry.c | 13 ++-
bindings/python/test/big_test.py | 2 +-
bindings/python/test/char_enc1.py | 32 +++++-
bindings/python/test/char_enc2.py | 140 ++++++++++++++-------------
bindings/python/test/char_enc3.py | 24 +++--
configure | 60 +++++++-----
doc/README.python | 10 +-
m4/python.m4 | 38 ++++++--
m4/version.m4 | 4 +-
src/flac.c | 18 ++--
test/Makefile.am | 6 +-
test/Makefile.in | 51 ++++++++--
test/flac_get_big.c | 3 +-
test/flac_get_far.c | 3 +-
test/flac_get_get.c | 3 +-
test/flac_get_get2.c | 3 +-
test/{flac_get_little.c => flac_get_int64.c} | 17 ++--
test/{flac_get_little.c => flac_get_int8.c} | 17 ++--
test/flac_get_little.c | 3 +-
test/{flac_get_far.c => flac_get_long.c} | 40 ++++----
test/flac_nframes.c | 3 +-
test/flac_seek.c | 3 +-
test/flac_seek_far.c | 3 +-
test/flac_sync.c | 4 +-
28 files changed, 395 insertions(+), 197 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dff2016..2996414 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2016-09-07 D. V. Wiebe <getdata at ketiltrout.net> svn:1097
+ GetData-0.9.4 released.
+
+ * doc/README.python doc/README.php: Update for PHP7/Py3.
+
+ * bindings/python/pyentry.c (gdpy_set_entry_from_tuple): Fix printf format.
+
+2016-09-01 D. V. Wiebe <getdata at ketiltrout.net> svn:1096
+ * src/flac.c (_GD_FlacOutput): Skip pointless memcpy when ns == 0.
+ * src/flac.c (_GD_FlacRead): Advance output after write.
+ * test/flac_get_long.c: Added.
+
+ * src/flac.c (_GD_FlacWriteCallback): Fix 1-byte data type check.
+ * test/flac_get_int8.c: Added.
+
+ * test/flac_get_int64.c: Added.
+
+ * m4/python.m4 (GD_PYTHON): Do the standard strip-exec_prefix-after-the-
+ fact thing with the pythondir to work around the debianification of
+ distutils in debian.
+
+2016-08-17 D. V. Wiebe <getdata at ketiltrout.net> svn:1095
+ * m4/python.m4: Add some superfluous exec's to work around a
+ bug in bash-4.1.
+
+ * bindings/python/gdpy_intern.h (gdpy_path_from_pyobj): Fix Python3
+ definition.
+
+ * bindings/python/pyentry.c (gdpy_entry_setspf gdpy_entry_setbitnum
+ gdpy_entry_setshift gdpy_entry_setcountval gdpy_entry_setthreshold):
+ initialise scalar to suppress compiler warning.
+
+ * bindings/python/test/big_test.py bindings/python/test/char_enc1.py
+ bindings/python/test/char_enc2.py bindings/python/test/char_enc3.py: Fix
+ all the encodings for Python3. Use os.fsdecode in Python3 for filename
+ checks.
+
2016-07-20 D. V. Wiebe <getdata at ketiltrout.net> svn:1091
GetData-0.9.3 released.
diff --git a/NEWS b/NEWS
index 977a29e..b85a2c4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,14 +1,35 @@
-New in version 0.9.3:
+New in version 0.9.4:
- API Changes:
+ Library Changes:
- * gd_verbose_prefix() can now be used on invalid dirfiles. Previously,
- this function would return GD_E_BAD_DIRFILE when passed an invalid
- DIRFILE pointer.
+ * BUG FIX: Arbitrarily-long reads of FLAC-encoded files now work.
+ Previously, each FLAC frame was written to the start of the output
+ buffer, overwriting the previous frame, and leaving most of the
+ buffer uninitialised. Reported by S. J. Benton.
- * BUG FIX: When trying to access a LINTERP table file in a non-existent
- directory, GetData now reports the correct error (No such file or
- directory). Reported by Johanna Nagy.
+ * BUG FIX: Data read from FLAC-encoded 1-byte types are now correct.
+ Previously, although all data requested was read, only the first half
+ would be returned, encoded as 16-bit data (i.e., with a zero-byte
+ between every sample).
+
+ Bindings Changes:
+
+ * PYTHON BUG FIX: An erroreous preprocessor definition which made the
+ Python bindings unbuildable for Python 3 has been fixed. Reported by
+ Akito Kusaka.
+
+ Miscellaneous:
+
+ * A work-around has been implemented in the configure script to avoid a
+ bug in bash 4.1's parser. Reported by Akito Kusaka.
+
+ * The way configure decides the Python module path has changed slightly
+ to provide a better default under debian-based systems when using
+ debhelper. Reported by S. J. Benton.
+
+|=========================================================================|
+
+New in version 0.9.3:
Library Changes:
@@ -27,6 +48,16 @@ New in version 0.9.3:
* BUG FIX: On platforms where char is signed, the library no longer
rejects field names containing bytes with the top bit set.
+ API Changes:
+
+ * gd_verbose_prefix() can now be used on invalid dirfiles. Previously,
+ this function would return GD_E_BAD_DIRFILE when passed an invalid
+ DIRFILE pointer.
+
+ * BUG FIX: When trying to access a LINTERP table file in a non-existent
+ directory, GetData now reports the correct error (No such file or
+ directory). Reported by Johanna Nagy.
+
Bindings Changes:
* PHP: PHP7 support has been added.
@@ -1053,7 +1084,7 @@ New in version 0.8.0:
these fields' metadata caches or else change the name in those
definitions as well.
- * BUG FIX: The invalid syntax "/META parent/child granchild ..." is now
+ * BUG FIX: The invalid syntax "/META parent/child grandchild ..." is now
properly rejected by the parser. Previously it half-worked, resulting
in a segfault in gd_close().
@@ -1387,7 +1418,7 @@ New in version 0.7.0:
computes A/X for vector X and scalar A, and CARRAY, which is an array
of CONST scalars. A few other changes are listed below.
- * Like CONST fields, CARRAY elements can be used as parametersin the
+ * Like CONST fields, CARRAY elements can be used as parameters in the
definition of other fields. Syntax is 'field<n>', where 'field' is the
field name and 'n' the element index in the CARRAY (and the angle
brackets are literal angle brackets). If the '<n>' is omitted, the
diff --git a/bindings/matlab/getdata_constants.m b/bindings/matlab/getdata_constants.m
index 674eff8..8090715 100644
--- a/bindings/matlab/getdata_constants.m
+++ b/bindings/matlab/getdata_constants.m
@@ -31,7 +31,7 @@ function GD = getdata_constants()
% See also GETDATA
GD = struct(...
- 'VERSION', '0.9.3a', ...
+ 'VERSION', '0.9.4a', ...
'E_OK', int32(0), ...
'E_FORMAT', int32(2), ...
'E_CREAT', int32(4), ...
diff --git a/bindings/python/gdpy_intern.h b/bindings/python/gdpy_intern.h
index 5093b86..fd88c30 100644
--- a/bindings/python/gdpy_intern.h
+++ b/bindings/python/gdpy_intern.h
@@ -188,7 +188,7 @@ union gdpy_quadruple_value {
#define gdpyobj_from_path PyString_FromString
#else
extern char *gdpy_path_from_pyobj_(PyObject*, int);
-#define gdpy_path_from_pyobj(o,c,d) gdpy_path_from_pyobj_(o,d)
+#define gdpy_path_from_pyobj(o,c) gdpy_path_from_pyobj_(o,1)
#define gdpyobj_from_path PyUnicode_DecodeFSDefault
#endif
diff --git a/bindings/python/pyentry.c b/bindings/python/pyentry.c
index 4bae1ab..bf502b4 100644
--- a/bindings/python/pyentry.c
+++ b/bindings/python/pyentry.c
@@ -196,8 +196,7 @@ static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple,
size = PyTuple_Size(tuple);
if (size < min) {
PyErr_Format(PyExc_TypeError, "'pygetdata.entry' "
- "%s: needed %d entry parameters, but got only %" PRIdSIZE,
- name, min, size);
+ "%s: needed %d entry parameters, but got only %li", name, min, size);
dreturnvoid();
return;
}
@@ -1151,7 +1150,7 @@ static int gdpy_entry_setspf(struct gdpy_entry_t *self, PyObject *value,
void *closure)
{
unsigned int spf = 0;
- char *scalar;
+ char *scalar = NULL;
dtrace("%p, %p, %p", self, value, closure);
@@ -1587,7 +1586,7 @@ static int gdpy_entry_setbitnum(struct gdpy_entry_t *self, PyObject *value,
void *closure)
{
int bitnum = 0;
- char *scalar;
+ char *scalar = NULL;
dtrace("%p, %p, %p", self, value, closure);
if (self->E->field_type != GD_BIT_ENTRY &&
@@ -1768,7 +1767,7 @@ static int gdpy_entry_setshift(struct gdpy_entry_t *self, PyObject *value,
void *closure)
{
int64_t shift = 0;
- char *scalar;
+ char *scalar = NULL;
dtrace("%p, %p, %p", self, value, closure);
@@ -1819,7 +1818,7 @@ static int gdpy_entry_setcountval(struct gdpy_entry_t *self, PyObject *value,
void *closure)
{
int count_val = 0;
- char *scalar;
+ char *scalar = NULL;
dtrace("%p, %p, %p", self, value, closure);
@@ -2334,7 +2333,7 @@ static int gdpy_entry_setthreshold(struct gdpy_entry_t *self, PyObject *value,
void *closure)
{
gd_triplet_t t;
- char *scalar;
+ char *scalar = NULL;
dtrace("%p, %p, %p", self, value, closure);
diff --git a/bindings/python/test/big_test.py b/bindings/python/test/big_test.py
index eb21c41..cb6da8a 100644
--- a/bindings/python/test/big_test.py
+++ b/bindings/python/test/big_test.py
@@ -346,7 +346,7 @@ try:
n = d.getdata("x", pygetdata.INT, first_frame=5, num_frames=1)
except:
CheckException(38,pygetdata.BadCodeError)
- CheckSimple(38,d.error_string,"Field not found: x")
+ CheckSimple(38,d.error_string,B("Field not found: x"))
# 40: entry (raw) check
try:
diff --git a/bindings/python/test/char_enc1.py b/bindings/python/test/char_enc1.py
index 30ed38e..87c5da6 100644
--- a/bindings/python/test/char_enc1.py
+++ b/bindings/python/test/char_enc1.py
@@ -27,6 +27,24 @@ import pygetdata
# Python2/3 abstraction:
+# a unicode character
+def C(c):
+ if sys.version[:1] == '3':
+ return chr(c)
+ return unichr(c)
+
+# an encoded character (byte)
+def E(c):
+ if sys.version[:1] == '3':
+ return bytes([c])
+ return chr(c)
+
+# a filesystem decoded string
+def F(s):
+ if sys.version[:1] == '3':
+ return os.fsdecode(s)
+ return s
+
# an encoded string
def B(s):
if sys.version[:1] == '3':
@@ -54,7 +72,7 @@ def CheckSimple(t,v,g):
def CheckEOS(t,v,g):
global ne
- if (U(v)[-len(U(g)):] != U(g)):
+ if (v[-len(g):] != g):
ne+=1
print ("n[", t, "] =", repr(v), "expected", repr(g))
@@ -63,14 +81,17 @@ os.system("rm -rf dirfile")
os.mkdir("dirfile")
# Encoded string (koi8-r)
-estring = B('\xF3\xD4\xD2\xCF\xCB\xC1')
+estring = E(0xF3) + E(0xD4) + E(0xD2) + E(0xCF) + E(0xCB) + E(0xC1)
+
+# Filesystem *decoded* string
+fstring = F(estring)
# byte-escaped (used for Dirfile metadata)
xstring = B('\\xF3\\xD4\\xD2\\xCF\\xCB\\xC1')
# The decoded version
-ustring = unichr(0x421) + unichr(0x442) + unichr(0x440) + unichr(0x43E) + \
- unichr(0x43A) + unichr(0x430)
+ustring = C(0x421) + C(0x442) + C(0x440) + C(0x43E) + \
+ C(0x43A) + C(0x430)
# Unicode escaped, which will show up in ASCII-ified error messages
xustring = B("\\u0421\\u0442\\u0440\\u043e\\u043a\\u0430")
@@ -85,6 +106,7 @@ f.write(
xstring + B("_c1 CONST UINT8 1\n") +
xstring + B("_c2 CONST UINT8 1\n") +
xstring + B("_r1 RAW UINT8 ") + xstring + B("_spf\n") +
+ B("r2 RAW UINT8 ") + xstring + B("_spf\n") +
B("l1 LINTERP in ") + xstring + B("\n") +
B("l1/") + xstring + B("_s1 STRING ") + xstring + B("1\n") +
B("l1/") + xstring + B("_s2 STRING ") + xstring + B("2\n") +
@@ -179,7 +201,7 @@ CheckSimple(29,c.spf,ustring + "_spf")
CheckSimple(30,c.parameters,(1, ustring + "_spf"))
c = D.entry("l1")
-CheckSimple(31,c.parameters,("in", estring))
+CheckSimple(31,c.parameters,("in", fstring))
c = D.entry("d1")
CheckSimple(32,c.in_fields,(ustring + "_i1", ustring + "_i2"))
diff --git a/bindings/python/test/char_enc2.py b/bindings/python/test/char_enc2.py
index 9fd7ddd..d9003fa 100644
--- a/bindings/python/test/char_enc2.py
+++ b/bindings/python/test/char_enc2.py
@@ -27,12 +27,24 @@ import pygetdata
# Python2/3 abstraction:
+# an encoded character (byte)
+def E(c):
+ if sys.version[:1] == '3':
+ return bytes([c])
+ return chr(c)
+
# an encoded string
def B(s):
if sys.version[:1] == '3':
return bytes(s, "UTF-8")
return s
+# a filesystem decoded string
+def F(s):
+ if sys.version[:1] == '3':
+ return os.fsdecode(s)
+ return s
+
# a decoded string
def U(s):
if sys.version[:1] == '3':
@@ -63,18 +75,14 @@ os.system("rm -rf dirfile")
os.mkdir("dirfile")
# Encoded string (koi8-r)
-estring = B('\xF3\xD4\xD2\xCF\xCB\xC1')
+estring = E(0xF3) + E(0xD4) + E(0xD2) + E(0xCF) + E(0xCB) + E(0xC1)
+
+# Filesystem *decoded* string
+fstring = F(estring)
# byte-escaped (used for Dirfile metadata)
xstring = B('\\xF3\\xD4\\xD2\\xCF\\xCB\\xC1')
-# The decoded version
-ustring = unichr(0x421) + unichr(0x442) + unichr(0x440) + unichr(0x43E) + \
- unichr(0x43A) + unichr(0x430)
-
-# Unicode escaped, which will show up in ASCII-ified error messages
-xestring = B("\\u0421\\u0442\\u0440\\u043e\\u043a\\u0430")
-
f=open("dirfile/format", "wb")
f.write(
B("/ALIAS ") + xstring + B("_al ") + xstring + B("_t\n") +
@@ -129,108 +137,108 @@ except pygetdata.DirfileError:
c = D.carrays(return_type=pygetdata.NULL)
CheckSimple(3,len(c),2)
-CheckSimple(4,c[0][0],estring + "_a1")
-CheckSimple(5,c[1][0],estring + "_a2")
+CheckSimple(4,c[0][0],estring + B("_a1"))
+CheckSimple(5,c[1][0],estring + B("_a2"))
c = D.constants(return_type=pygetdata.UINT8)
CheckSimple(6,len(c),2)
-CheckSimple(7,c[0][0],estring + "_c1")
-CheckSimple(8,c[1][0],estring + "_c2")
+CheckSimple(7,c[0][0],estring + B("_c1"))
+CheckSimple(8,c[1][0],estring + B("_c2"))
c = D.mcarrays("l1", return_type=pygetdata.NULL)
CheckSimple(9,len(c),2)
-CheckSimple(10,c[0][0], estring + "_a1")
-CheckSimple(11,c[1][0], estring + "_a2")
+CheckSimple(10,c[0][0], estring + B("_a1"))
+CheckSimple(11,c[1][0], estring + B("_a2"))
c = D.mconstants("l1", return_type=pygetdata.UINT8)
CheckSimple(12,len(c),2)
-CheckSimple(13,c[0][0], estring + "_c1")
-CheckSimple(14,c[1][0], estring + "_c2")
+CheckSimple(13,c[0][0], estring + B("_c1"))
+CheckSimple(14,c[1][0], estring + B("_c2"))
c = D.strings()
CheckSimple(15,len(c),2)
-CheckSimple(16,c[0][0], estring + "_s1")
-CheckSimple(17,c[0][1], estring + "1")
-CheckSimple(18,c[0][0], estring + "_s1")
-CheckSimple(19,c[1][1], estring + "2")
+CheckSimple(16,c[0][0], estring + B("_s1"))
+CheckSimple(17,c[0][1], estring + B("1"))
+CheckSimple(18,c[0][0], estring + B("_s1"))
+CheckSimple(19,c[1][1], estring + B("2"))
c = D.mstrings("l1")
CheckSimple(20,len(c),2)
-CheckSimple(21,c[0][0], estring + "_s1")
-CheckSimple(22,c[0][1], estring + "1")
-CheckSimple(23,c[0][0], estring + "_s1")
-CheckSimple(24,c[1][1], estring + "2")
+CheckSimple(21,c[0][0], estring + B("_s1"))
+CheckSimple(22,c[0][1], estring + B("1"))
+CheckSimple(23,c[0][0], estring + B("_s1"))
+CheckSimple(24,c[1][1], estring + B("2"))
c = D.reference
-CheckSimple(25,c,estring + "_r1")
+CheckSimple(25,c,estring + B("_r1"))
-c = D.get_string(estring + "_s1")
-CheckSimple(26,c,estring + "1")
+c = D.get_string(estring + B("_s1"))
+CheckSimple(26,c,estring + B("1"))
-c = D.alias_target(estring + "_al")
-CheckSimple(27,c,estring + "_t")
+c = D.alias_target(estring + B("_al"))
+CheckSimple(27,c,estring + B("_t"))
-c = D.entry(estring + "_r1")
-CheckSimple(28,c.name,estring + "_r1")
-CheckSimple(29,c.spf,estring + "_spf")
-CheckSimple(30,c.parameters,(1, estring + "_spf"))
+c = D.entry(estring + B("_r1"))
+CheckSimple(28,c.name,estring + B("_r1"))
+CheckSimple(29,c.spf,estring + B("_spf"))
+CheckSimple(30,c.parameters,(1, estring + B("_spf")))
c = D.entry("l1")
-CheckSimple(31,c.parameters,("in", estring))
+CheckSimple(31,c.parameters,(B("in"), fstring))
c = D.entry("d1")
-CheckSimple(32,c.in_fields,(estring + "_i1", estring + "_i2"))
-CheckSimple(33,c.parameters,(estring + "_i1", estring + "_i2"))
+CheckSimple(32,c.in_fields,(estring + B("_i1"), estring + B("_i2")))
+CheckSimple(33,c.parameters,(estring + B("_i1"), estring + B("_i2")))
c = D.entry("e1")
-CheckSimple(35,c.dividend,estring + "_dv")
-CheckSimple(36,c.parameters,("in", estring + "_dv"))
+CheckSimple(35,c.dividend,estring + B("_dv"))
+CheckSimple(36,c.parameters,(B("in"), estring + B("_dv")))
c = D.entry("p1")
-CheckSimple(37,c.in_fields,(estring + "_i",))
-CheckSimple(38,c.shift,estring + "_ps")
-CheckSimple(39,c.parameters,(estring + "_i", estring + "_ps"))
+CheckSimple(37,c.in_fields,(estring + B("_i"),))
+CheckSimple(38,c.shift,estring + B("_ps"))
+CheckSimple(39,c.parameters,(estring + B("_i"), estring + B("_ps")))
c = D.entry("y1")
-CheckSimple(40,c.a,(estring + "_y1", 2, estring + "_y3"))
-CheckSimple(41,c.parameters,(estring + "_i",
- (estring + "_y1", 2, estring + "_y3")))
+CheckSimple(40,c.a,(estring + B("_y1"), 2, estring + B("_y3")))
+CheckSimple(41,c.parameters,(estring + B("_i"),
+ (estring + B("_y1"), 2, estring + B("_y3"))))
c = D.entry("o1")
-CheckSimple(42,c.in_fields,(estring + "_i",))
-CheckSimple(43,c.m,(estring + "_m",))
-CheckSimple(44,c.b,(estring + "_b",))
-CheckSimple(45,c.parameters,((estring + "_i",), (estring + "_m",),
- (estring + "_b",)))
+CheckSimple(42,c.in_fields,(estring + B("_i"),))
+CheckSimple(43,c.m,(estring + B("_m"),))
+CheckSimple(44,c.b,(estring + B("_b"),))
+CheckSimple(45,c.parameters,((estring + B("_i"),), (estring + B("_m"),),
+ (estring + B("_b"),)))
c = D.entry("o2")
-CheckSimple(46,c.in_fields,(estring + "_i1",estring + "_i2"))
-CheckSimple(47,c.m,(estring + "_m1",estring + "_m2"))
-CheckSimple(48,c.b,(estring + "_b1",estring + "_b2"))
-CheckSimple(49,c.parameters,((estring + "_i1",estring + "_i2"),
- (estring + "_m1",estring + "_m2"),(estring + "_b1",estring + "_b2")))
+CheckSimple(46,c.in_fields,(estring + B("_i1"),estring + B("_i2")))
+CheckSimple(47,c.m,(estring + B("_m1"),estring + B("_m2")))
+CheckSimple(48,c.b,(estring + B("_b1"),estring + B("_b2")))
+CheckSimple(49,c.parameters,((estring + B("_i1"),estring + B("_i2")),
+ (estring + B("_m1"),estring + B("_m2")),(estring + B("_b1"),estring + B("_b2"))))
c = D.entry("o3")
-CheckSimple(50,c.in_fields,(estring + "_i1",estring + "_i2",estring + "_i3"))
-CheckSimple(51,c.m,(estring + "_m1",estring + "_m2",estring + "_m3"))
-CheckSimple(52,c.b,(estring + "_b1",estring + "_b2",estring + "_b3"))
-CheckSimple(53,c.parameters,((estring + "_i1",estring + "_i2",estring + "_i3"),
- (estring + "_m1",estring + "_m2",estring + "_m3"),
- (estring + "_b1",estring + "_b2",estring + "_b3")))
+CheckSimple(50,c.in_fields,(estring + B("_i1"),estring + B("_i2"),estring + B("_i3")))
+CheckSimple(51,c.m,(estring + B("_m1"),estring + B("_m2"),estring + B("_m3")))
+CheckSimple(52,c.b,(estring + B("_b1"),estring + B("_b2"),estring + B("_b3")))
+CheckSimple(53,c.parameters,((estring + B("_i1"),estring + B("_i2"),estring + B("_i3")),
+ (estring + B("_m1"),estring + B("_m2"),estring + B("_m3")),
+ (estring + B("_b1"),estring + B("_b2"),estring + B("_b3"))))
c = D.entry("w1")
-CheckSimple(54,c.parameters,("a", "b", pygetdata.WINDOP_EQ, estring + "_t1"))
+CheckSimple(54,c.parameters,(B("a"), B("b"), pygetdata.WINDOP_EQ, estring + B("_t1")))
c = D.entry("w2")
-CheckSimple(55,c.parameters,("a", "b", pygetdata.WINDOP_SET, estring + "_t2"))
+CheckSimple(55,c.parameters,(B("a"), B("b"), pygetdata.WINDOP_SET, estring + B("_t2")))
c = D.entry("w3")
-CheckSimple(56,c.parameters,("a", "b", pygetdata.WINDOP_GT, estring + "_t3"))
+CheckSimple(56,c.parameters,(B("a"), B("b"), pygetdata.WINDOP_GT, estring + B("_t3")))
c = D.entry("m1")
-CheckSimple(57,c.count_val, estring + "_cv")
-CheckSimple(58,c.period, estring + "_pd")
-CheckSimple(59,c.parameters,("a", "b", estring + "_cv", estring + "_pd"))
+CheckSimple(57,c.count_val, estring + B("_cv"))
+CheckSimple(58,c.period, estring + B("_pd"))
+CheckSimple(59,c.parameters,(B("a"), B("b"), estring + B("_cv"), estring + B("_pd")))
D.discard()
del D
diff --git a/bindings/python/test/char_enc3.py b/bindings/python/test/char_enc3.py
index dad11b8..5c0983b 100644
--- a/bindings/python/test/char_enc3.py
+++ b/bindings/python/test/char_enc3.py
@@ -27,12 +27,24 @@ import pygetdata
# Python2/3 abstraction:
+# an encoded character (byte)
+def E(c):
+ if sys.version[:1] == '3':
+ return bytes([c])
+ return chr(c)
+
# an encoded string
def B(s):
if sys.version[:1] == '3':
return bytes(s, "UTF-8")
return s
+# a filesystem decoded string
+def F(s):
+ if sys.version[:1] == '3':
+ return os.fsdecode(s)
+ return s
+
# a decoded string
def U(s):
if sys.version[:1] == '3':
@@ -91,14 +103,14 @@ os.system("rm -rf dirfile")
os.mkdir("dirfile")
# Encoded string (koi8-r)
-estring = B('\xF3\xD4\xD2\xCF\xCB\xC1')
+estring = E(0xF3) + E(0xD4) + E(0xD2) + E(0xCF) + E(0xCB) + E(0xC1)
+
+# Filesystem *decoded* string
+fstring = F(estring)
# byte-escaped (used for Dirfile metadata)
xstring = B('\\xF3\\xD4\\xD2\\xCF\\xCB\\xC1')
-# Unicode escaped, which will show up in ASCII-ified error messages
-xustring = B("\\u0421\\u0442\\u0440\\u043e\\u043a\\u0430")
-
f=open("dirfile/format", "wb")
f.write(
B("/ALIAS ") + xstring + B("_al ") + xstring + B("_t\n") +
@@ -221,7 +233,7 @@ CheckExc(6)
try:
e = 1
- c = D.alias_target(estring + "_al")
+ c = D.alias_target(estring + B("_al"))
except UnicodeDecodeError:
e = 0
@@ -239,7 +251,7 @@ CheckParms(9,c)
# This works because LINTERP table is FS encoded
c = D.entry("l1")
-CheckSimple(10,c.parameters,("in", estring))
+CheckSimple(10,c.parameters,("in", fstring))
c = D.entry("d1")
CheckIns(11, c)
diff --git a/configure b/configure
index da3b768..b726151 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GetData 0.9.3.
+# Generated by GNU Autoconf 2.69 for GetData 0.9.4.
#
# Report bugs to <getdata-devel at lists.sourceforge.net>.
#
@@ -598,8 +598,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GetData'
PACKAGE_TARNAME='getdata'
-PACKAGE_VERSION='0.9.3'
-PACKAGE_STRING='GetData 0.9.3'
+PACKAGE_VERSION='0.9.4'
+PACKAGE_STRING='GetData 0.9.4'
PACKAGE_BUGREPORT='getdata-devel at lists.sourceforge.net'
PACKAGE_URL='http://getdata.sourceforge.net/'
@@ -1548,7 +1548,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GetData 0.9.3 to adapt to many kinds of systems.
+\`configure' configures GetData 0.9.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1618,7 +1618,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GetData 0.9.3:";;
+ short | recursive ) echo "Configuration of GetData 0.9.4:";;
esac
cat <<\_ACEOF
@@ -1839,7 +1839,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GetData configure 0.9.3
+GetData configure 0.9.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -3014,7 +3014,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GetData $as_me 0.9.3, which was
+It was created by GetData $as_me 0.9.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3372,7 +3372,7 @@ $as_echo "#define GETDATA_MAJOR 0" >>confdefs.h
$as_echo "#define GETDATA_MINOR 9" >>confdefs.h
-$as_echo "#define GETDATA_REVISION 3" >>confdefs.h
+$as_echo "#define GETDATA_REVISION 4" >>confdefs.h
$as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h
@@ -3382,11 +3382,11 @@ GETDATA_MAJOR=0
GETDATA_MINOR=9
-GETDATA_REVISION=3
+GETDATA_REVISION=4
GETDATA_VERSION_SUFFIX=
-GETDATA_LIB_VERSION=0.9.3
+GETDATA_LIB_VERSION=0.9.4
@@ -3398,7 +3398,7 @@ GETDATA_LIB_VERSION=0.9.3
GETDATA_IFACE_VERSION=7
-GETDATA_IMPL_REVISION=3
+GETDATA_IMPL_REVISION=4
GETDATA_IFACE_AGE=0
@@ -4350,7 +4350,7 @@ fi
# Define the identity of the package.
PACKAGE='getdata'
- VERSION='0.9.3'
+ VERSION='0.9.4'
cat >>confdefs.h <<_ACEOF
@@ -4817,9 +4817,9 @@ _ACEOF
fi
-DEFINE_GD_GETDATA_VERSION="#define GD_GETDATA_VERSION \"0.9.3\""
+DEFINE_GD_GETDATA_VERSION="#define GD_GETDATA_VERSION \"0.9.4\""
-DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} %i%02i 9 3`"
+DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} %i%02i 9 4`"
echo
echo "*** Checking host environment"
@@ -26176,7 +26176,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool at gnu.org>."
lt_cl_version="\
-GetData config.lt 0.9.3
+GetData config.lt 0.9.4
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -32692,7 +32692,7 @@ $as_echo "$PYTHON_VERSION" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python ABI version" >&5
$as_echo_n "checking Python ABI version... " >&6; }
- PYTHON_LDVERSION=$(${PYTHON} - <<EOF 2>/dev/null
+ PYTHON_LDVERSION=$(exec ${PYTHON} - <<EOF 2>/dev/null
try:
import sysconfig
except ImportError:
@@ -32724,7 +32724,7 @@ $as_echo "$PYTHON_CPPFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python LDFLAGS" >&5
$as_echo_n "checking Python LDFLAGS... " >&6; }
- PYTHON_LIBDIR=$(${PYTHON} - <<EOF 2>/dev/null
+ PYTHON_LIBDIR=$(exec ${PYTHON} - <<EOF 2>/dev/null
try:
import sysconfig
except ImportError:
@@ -32751,18 +32751,28 @@ $as_echo "$PYTHON_PLATFORM" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python extension module directory" >&5
$as_echo_n "checking Python extension module directory... " >&6; }
if test "x${local_python_modpath}" = "x"; then
- pythondir=$(${PYTHON} - <<EOF 2>/dev/null
+
+ pyexec_prefix=$exec_prefix
+ test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix
+ test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix
+
+ prefixed_pythondir=$(exec ${PYTHON} - <<EOF 2>/dev/null
import sys
if sys.version[:1] == '3':
import sysconfig
- print (sysconfig.get_path('platlib', vars={'platbase': '\${exec_prefix}'}))
+ print (sysconfig.get_path('platlib', vars={'platbase': "${pyexec_prefix}"}))
else:
from distutils import sysconfig
- print (sysconfig.get_python_lib(1,0,prefix='\${exec_prefix}'))
+ print (sysconfig.get_python_lib(1,0,prefix="${pyexec_prefix}"))
EOF
)
- if test "x${pythondir}" = "xNone" -o "x${pythondir}" = "x"; then
+ if test "x${prefixed_pythondir}" = "xNone" -o "x${prefixed_pythondir}" = "x";
+ then
pythondir='\${exec_prefix}/lib/python${PYTHON_LDVERSION}/site-packages'
+ else
+ esc_pyexec_prefix=$(echo ${pyexec_prefix} | ${SED} -e 's/\//\\\//g')
+ pythondir=$(echo ${prefixed_pythondir} | \
+ ${SED} -e "s/^${esc_pyexec_prefix}/\${exec_prefix}/")
fi
else
pythondir=$local_python_modpath
@@ -32774,7 +32784,7 @@ $as_echo "$pythondir" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python object suffix" >&5
$as_echo_n "checking Python object suffix... " >&6; }
- PYTHON_OBJECT_SUFFIX=$(${PYTHON} - <<EOF 2>/dev/null
+ PYTHON_OBJECT_SUFFIX=$(exec ${PYTHON} - <<EOF 2>/dev/null
try:
import sysconfig
except ImportError:
@@ -32788,7 +32798,7 @@ EOF
if test "x${PYTHON_OBJECT_SUFFIX}" = "xNone"; then
- PYTHON_OBJECT_SUFFIX=$(${PYTHON} - <<EOF 2>/dev/null
+ PYTHON_OBJECT_SUFFIX=$(exec ${PYTHON} - <<EOF 2>/dev/null
try:
import sysconfig
except ImportError:
@@ -35549,7 +35559,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GetData $as_me 0.9.3, which was
+This file was extended by GetData $as_me 0.9.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -35616,7 +35626,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GetData config.status 0.9.3
+GetData config.status 0.9.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/doc/README.python b/doc/README.python
index 798981e..5a56fe8 100644
--- a/doc/README.python
+++ b/doc/README.python
@@ -1,13 +1,19 @@
PYTHON BINDINGS FOR GETDATA
===========================
-The python bindings consist of a python extension module, `pygetdata.so'. They
-should work with Python version 2.3, or any later 2.x version.
+The python bindings consist of a python extension module, pygetdata. They
+should work with:
+* Python2: version 2.4, or later
+* Python3: version 3.2, or later
Numerical Python (NumPy) is required to build and use the bindings. By default,
data returned from the bindings will be returned in NumPy arrays, but the
bindings can be persuaded to return data as Python lists, if desired.
+Under Python3, string values are returned as bytes objects unless a character
+encoding is specified which is used to convert to (Unicode) strings. See the
+character_encoding member.
+
Full documentation for the Python bindings to the GetData library is contained
within the pygetdata module itself. To read this documentation, execute
diff --git a/m4/python.m4 b/m4/python.m4
index 92127fd..ea24528 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -21,7 +21,7 @@ dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
dnl GD_LOG_SHELL(STUFF)
dnl ---------------------------------------------------------------
dnl Run STUFF as a shell command and log it
-AC_DEFUN([AM_LOG_SHELL],
+AC_DEFUN([GD_LOG_SHELL],
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
ac_status=$?
@@ -31,9 +31,12 @@ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
dnl GD_PYTHON_CONFIGVAR(VAR, KEY)
dnl ---------------------------------------------------------------
dnl Store the value of config_var KEY in VAR
+dnl
+dnl the superfluous exec call here is to work around a bug in
+dnl bash-4.1's parser. (See change 1.hh in bash-4.2-alpha)
AC_DEFUN([GD_PYTHON_CONFIGVAR],
[
- $1=$(${PYTHON} - <<EOF 2>/dev/null
+ $1=$(exec ${PYTHON} - <<EOF 2>/dev/null
try:
import sysconfig
except ImportError:
@@ -52,7 +55,7 @@ dnl If PROG is a Python3 interpreter, set have_python3 to "yes"
dnl otherwise set it to "no"
AC_DEFUN([GD_PYTHON3],
[
-AS_IF(AM_LOG_SHELL(
+AS_IF(GD_LOG_SHELL(
[$1 -c 'import sys; sys.exit(int(sys.version@<:@:1@:>@) - 3)']
), [have_python3=yes],[have_python3=no])
])
@@ -194,20 +197,41 @@ AC_MSG_RESULT([$PYTHON_PLATFORM])
AC_SUBST([PYTHON_PLATFORM])
dnl calculate the extension module directory
+dnl
+dnl Debian's version of distutils is too clever. Its install paths change
+dnl based on the prefix you provide. We pass the current best-guess for
+dnl ${exec_prefix} as a result. This may lead to incorrect behaviour at
+dnl make install time, if the user changes PREFIX then, but this should do
+dnl the right thing in the common case, where prefix doesn't change after
+dnl configure-time.
+dnl
+dnl See the comment under GD_PYTHON_CONFIGVAR for the reason for the
+dnl exec call here
AC_MSG_CHECKING([Python extension module directory])
if test "x${local_python_modpath}" = "x"; then
- pythondir=$(${PYTHON} - <<EOF 2>/dev/null
+
+dnl Calculate current exec_prefix
+ pyexec_prefix=$exec_prefix
+ test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix
+ test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix
+
+ prefixed_pythondir=$(exec ${PYTHON} - <<EOF 2>/dev/null
import sys
if sys.version[[:1]] == '3':
import sysconfig
- print (sysconfig.get_path('platlib', vars={'platbase': '\${exec_prefix}'}))
+ print (sysconfig.get_path('platlib', vars={'platbase': "${pyexec_prefix}"}))
else:
from distutils import sysconfig
- print (sysconfig.get_python_lib(1,0,prefix='\${exec_prefix}'))
+ print (sysconfig.get_python_lib(1,0,prefix="${pyexec_prefix}"))
EOF
)
- if test "x${pythondir}" = "xNone" -o "x${pythondir}" = "x"; then
+ if test "x${prefixed_pythondir}" = "xNone" -o "x${prefixed_pythondir}" = "x";
+ then
pythondir='\${exec_prefix}/lib/python${PYTHON_LDVERSION}/site-packages'
+ else
+ esc_pyexec_prefix=$(echo ${pyexec_prefix} | ${SED} -e 's/\//\\\//g')
+ pythondir=$(echo ${prefixed_pythondir} | \
+ ${SED} -e "s/^${esc_pyexec_prefix}/\${exec_prefix}/")
fi
else
pythondir=$local_python_modpath
diff --git a/m4/version.m4 b/m4/version.m4
index c347ed6..42a1ba7 100644
--- a/m4/version.m4
+++ b/m4/version.m4
@@ -20,7 +20,7 @@ dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
m4_define(getdata_major, 0)
m4_define(getdata_minor, 9)
-m4_define(getdata_revision, 3)
+m4_define(getdata_revision, 4)
m4_define(getdata_extra, [])
m4_define(getdata_pkg_extra,[])
m4_define(getdata_version,
@@ -31,7 +31,7 @@ m4_define(getdata_pkg_version,
dnl libgetdata current interface version
m4_define(getdata_iface_version, 7)
dnl libgetdata current interface implementation revision
-m4_define(getdata_impl_revision, 3)
+m4_define(getdata_impl_revision, 4)
dnl libgetdata interface age (current interface - oldest supported interface)
m4_define(getdata_iface_age, 0)
diff --git a/src/flac.c b/src/flac.c
index ffe5c5e..42f3ee2 100644
--- a/src/flac.c
+++ b/src/flac.c
@@ -106,7 +106,7 @@ static FLAC__StreamDecoderWriteStatus _GD_FlacWriteCallback(
ptr = (int16_t*)gdfl->data;
/* Copy and dechannelise the decoded data to our local buffer */
- if (gdfl->bps == 1)
+ if (gdfl->bps == 8)
for (u = 0; u < frame->header.blocksize; ++u)
/* there's only one channel in this case */
gdfl->data[u] = (int8_t)buffer[0][u];
@@ -267,8 +267,10 @@ static size_t _GD_FlacOutput(struct gd_flacdata *gdfl, gd_type_t data_type,
if (ns > gdfl->dlen - gdfl->pos)
ns = gdfl->dlen - gdfl->pos;
- memcpy(output, gdfl->data + gdfl->pos, ns * GD_SIZE(data_type));
- gdfl->pos += ns;
+ if (ns > 0) {
+ memcpy(output, gdfl->data + gdfl->pos, ns * GD_SIZE(data_type));
+ gdfl->pos += ns;
+ }
dreturn("%" PRIuSIZE, ns);
return ns;
@@ -278,15 +280,17 @@ ssize_t _GD_FlacRead(struct gd_raw_file_ *restrict file, void *restrict data,
gd_type_t data_type, size_t nmemb)
{
struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata;
- void *output = data;
- size_t ns = nmemb;
+ char *output = data;
+ size_t s, ns = nmemb;
dtrace("%p, %p, 0x%X, %" PRIuSIZE, file, data, data_type, nmemb);
for (;;) {
/* copy the currently loaded frame to the output */
- ns -= _GD_FlacOutput(gdfl, data_type, output, ns);
- if (ns == 0)
+ s = _GD_FlacOutput(gdfl, data_type, output, ns);
+ output += s * GD_SIZE(data_type);
+
+ if ((ns -= s) == 0)
break;
/* Decode one frame */
diff --git a/test/Makefile.am b/test/Makefile.am
index 6f82754..f53a676 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -166,9 +166,9 @@ ERROR_TESTS=error error_error error_num error_short error_verbose \
FILE_TESTS=file file_code file_type
FLAC_TESTS=flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \
- flac_get_little flac_nframes flac_put_big flac_put_complex128 \
- flac_put_float64 flac_put_int32 flac_put_little flac_seek \
- flac_seek_far flac_sync
+ flac_get_int8 flac_get_int64 flac_get_little flac_get_long \
+ flac_nframes flac_put_big flac_put_complex128 flac_put_float64 \
+ flac_put_int32 flac_put_little flac_seek flac_seek_far flac_sync
FLIST_TESTS=flist flist0 flist2 flist_hidden flist_invalid flist_meta \
flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \
diff --git a/test/Makefile.in b/test/Makefile.in
index 84bab74..31c72f4 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -343,11 +343,13 @@ am__EXEEXT_19 = error$(EXEEXT) error_error$(EXEEXT) error_num$(EXEEXT) \
am__EXEEXT_20 = file$(EXEEXT) file_code$(EXEEXT) file_type$(EXEEXT)
am__EXEEXT_21 = flac_add$(EXEEXT) flac_get_big$(EXEEXT) \
flac_get_far$(EXEEXT) flac_get_get$(EXEEXT) \
- flac_get_get2$(EXEEXT) flac_get_little$(EXEEXT) \
- flac_nframes$(EXEEXT) flac_put_big$(EXEEXT) \
- flac_put_complex128$(EXEEXT) flac_put_float64$(EXEEXT) \
- flac_put_int32$(EXEEXT) flac_put_little$(EXEEXT) \
- flac_seek$(EXEEXT) flac_seek_far$(EXEEXT) flac_sync$(EXEEXT)
+ flac_get_get2$(EXEEXT) flac_get_int8$(EXEEXT) \
+ flac_get_int64$(EXEEXT) flac_get_little$(EXEEXT) \
+ flac_get_long$(EXEEXT) flac_nframes$(EXEEXT) \
+ flac_put_big$(EXEEXT) flac_put_complex128$(EXEEXT) \
+ flac_put_float64$(EXEEXT) flac_put_int32$(EXEEXT) \
+ flac_put_little$(EXEEXT) flac_seek$(EXEEXT) \
+ flac_seek_far$(EXEEXT) flac_sync$(EXEEXT)
am__EXEEXT_22 = flist$(EXEEXT) flist0$(EXEEXT) flist2$(EXEEXT) \
flist_hidden$(EXEEXT) flist_invalid$(EXEEXT) \
flist_meta$(EXEEXT) flist_meta2$(EXEEXT) \
@@ -2402,10 +2404,22 @@ flac_get_get2_SOURCES = flac_get_get2.c
flac_get_get2_OBJECTS = flac_get_get2.$(OBJEXT)
flac_get_get2_LDADD = $(LDADD)
flac_get_get2_DEPENDENCIES = ../src/libgetdata.la
+flac_get_int64_SOURCES = flac_get_int64.c
+flac_get_int64_OBJECTS = flac_get_int64.$(OBJEXT)
+flac_get_int64_LDADD = $(LDADD)
+flac_get_int64_DEPENDENCIES = ../src/libgetdata.la
+flac_get_int8_SOURCES = flac_get_int8.c
+flac_get_int8_OBJECTS = flac_get_int8.$(OBJEXT)
+flac_get_int8_LDADD = $(LDADD)
+flac_get_int8_DEPENDENCIES = ../src/libgetdata.la
flac_get_little_SOURCES = flac_get_little.c
flac_get_little_OBJECTS = flac_get_little.$(OBJEXT)
flac_get_little_LDADD = $(LDADD)
flac_get_little_DEPENDENCIES = ../src/libgetdata.la
+flac_get_long_SOURCES = flac_get_long.c
+flac_get_long_OBJECTS = flac_get_long.$(OBJEXT)
+flac_get_long_LDADD = $(LDADD)
+flac_get_long_DEPENDENCIES = ../src/libgetdata.la
flac_nframes_SOURCES = flac_nframes.c
flac_nframes_OBJECTS = flac_nframes.$(OBJEXT)
flac_nframes_LDADD = $(LDADD)
@@ -5735,7 +5749,8 @@ SOURCES = add_add.c add_affix.c add_alias.c add_alias_affix.c \
error_error.c error_num.c error_short.c error_verbose.c \
error_verbose_prefix.c file.c file_code.c file_type.c \
flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \
- flac_get_get2.c flac_get_little.c flac_nframes.c \
+ flac_get_get2.c flac_get_int64.c flac_get_int8.c \
+ flac_get_little.c flac_get_long.c flac_nframes.c \
flac_put_big.c flac_put_complex128.c flac_put_float64.c \
flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \
flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \
@@ -6114,7 +6129,8 @@ DIST_SOURCES = add_add.c add_affix.c add_alias.c add_alias_affix.c \
error_error.c error_num.c error_short.c error_verbose.c \
error_verbose_prefix.c file.c file_code.c file_type.c \
flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \
- flac_get_get2.c flac_get_little.c flac_nframes.c \
+ flac_get_get2.c flac_get_int64.c flac_get_int8.c \
+ flac_get_little.c flac_get_long.c flac_nframes.c \
flac_put_big.c flac_put_complex128.c flac_put_float64.c \
flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \
flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \
@@ -6783,9 +6799,9 @@ ERROR_TESTS = error error_error error_num error_short error_verbose \
FILE_TESTS = file file_code file_type
FLAC_TESTS = flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \
- flac_get_little flac_nframes flac_put_big flac_put_complex128 \
- flac_put_float64 flac_put_int32 flac_put_little flac_seek \
- flac_seek_far flac_sync
+ flac_get_int8 flac_get_int64 flac_get_little flac_get_long \
+ flac_nframes flac_put_big flac_put_complex128 flac_put_float64 \
+ flac_put_int32 flac_put_little flac_seek flac_seek_far flac_sync
FLIST_TESTS = flist flist0 flist2 flist_hidden flist_invalid flist_meta \
flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \
@@ -8687,10 +8703,22 @@ flac_get_get2$(EXEEXT): $(flac_get_get2_OBJECTS) $(flac_get_get2_DEPENDENCIES) $
@rm -f flac_get_get2$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(flac_get_get2_OBJECTS) $(flac_get_get2_LDADD) $(LIBS)
+flac_get_int64$(EXEEXT): $(flac_get_int64_OBJECTS) $(flac_get_int64_DEPENDENCIES) $(EXTRA_flac_get_int64_DEPENDENCIES)
+ @rm -f flac_get_int64$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(flac_get_int64_OBJECTS) $(flac_get_int64_LDADD) $(LIBS)
+
+flac_get_int8$(EXEEXT): $(flac_get_int8_OBJECTS) $(flac_get_int8_DEPENDENCIES) $(EXTRA_flac_get_int8_DEPENDENCIES)
+ @rm -f flac_get_int8$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(flac_get_int8_OBJECTS) $(flac_get_int8_LDADD) $(LIBS)
+
flac_get_little$(EXEEXT): $(flac_get_little_OBJECTS) $(flac_get_little_DEPENDENCIES) $(EXTRA_flac_get_little_DEPENDENCIES)
@rm -f flac_get_little$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(flac_get_little_OBJECTS) $(flac_get_little_LDADD) $(LIBS)
+flac_get_long$(EXEEXT): $(flac_get_long_OBJECTS) $(flac_get_long_DEPENDENCIES) $(EXTRA_flac_get_long_DEPENDENCIES)
+ @rm -f flac_get_long$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(flac_get_long_OBJECTS) $(flac_get_long_LDADD) $(LIBS)
+
flac_nframes$(EXEEXT): $(flac_nframes_OBJECTS) $(flac_nframes_DEPENDENCIES) $(EXTRA_flac_nframes_DEPENDENCIES)
@rm -f flac_nframes$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(flac_nframes_OBJECTS) $(flac_nframes_LDADD) $(LIBS)
@@ -12241,7 +12269,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_far.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_get.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_get2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_int64.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_int8.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_little.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_get_long.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_nframes.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_big.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/flac_put_complex128.Po at am__quote@
diff --git a/test/flac_get_big.c b/test/flac_get_big.c
index 11c0df3..c42fcb1 100644
--- a/test/flac_get_big.c
+++ b/test/flac_get_big.c
@@ -57,7 +57,8 @@ int main(void)
/* encode */
snprintf(command, 4096,
"%s --endian=big --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_get_far.c b/test/flac_get_far.c
index c7fe450..c598ba2 100644
--- a/test/flac_get_far.c
+++ b/test/flac_get_far.c
@@ -53,7 +53,8 @@ int main(void)
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_get_get.c b/test/flac_get_get.c
index 86a210d..c7457e5 100644
--- a/test/flac_get_get.c
+++ b/test/flac_get_get.c
@@ -54,7 +54,8 @@ int main(void)
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_get_get2.c b/test/flac_get_get2.c
index 3099283..cb00704 100644
--- a/test/flac_get_get2.c
+++ b/test/flac_get_get2.c
@@ -55,7 +55,8 @@ int main(void)
/* compress */
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_get_little.c b/test/flac_get_int64.c
similarity index 84%
copy from test/flac_get_little.c
copy to test/flac_get_int64.c
index bf9760e..c69f272 100644
--- a/test/flac_get_little.c
+++ b/test/flac_get_int64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015 D. V. Wiebe
+/* Copyright (C) 2016 D. V. Wiebe
*
***************************************************************************
*
@@ -29,10 +29,10 @@ int main(void)
const char *format = "dirfile/format";
const char *data = "dirfile/data";
const char *flacdata = "dirfile/data.flac";
- const char *format_data = "data RAW UINT16 8\n";
- uint16_t c[8];
+ const char *format_data = "data RAW UINT64 8\n";
+ int64_t c[8];
char command[4096];
- uint16_t data_data[256];
+ int64_t data_data[256];
int fd, n, error, r = 0;
#ifdef USE_FLAC
int i;
@@ -51,13 +51,14 @@ int main(void)
close(fd);
fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
- write(fd, data_data, 256 * sizeof(uint16_t));
+ write(fd, data_data, 256 * sizeof(uint64_t));
close(fd);
/* encode */
snprintf(command, 4096,
- "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "%s --endian=little --silent --sample-rate=1 --channels=4 --bps=16 "
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
@@ -66,7 +67,7 @@ int main(void)
#else
D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN);
#endif
- n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+ n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c);
error = gd_error(D);
#ifdef USE_FLAC
diff --git a/test/flac_get_little.c b/test/flac_get_int8.c
similarity index 86%
copy from test/flac_get_little.c
copy to test/flac_get_int8.c
index bf9760e..f5c7f6e 100644
--- a/test/flac_get_little.c
+++ b/test/flac_get_int8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015 D. V. Wiebe
+/* Copyright (C) 2016 D. V. Wiebe
*
***************************************************************************
*
@@ -29,10 +29,10 @@ int main(void)
const char *format = "dirfile/format";
const char *data = "dirfile/data";
const char *flacdata = "dirfile/data.flac";
- const char *format_data = "data RAW UINT16 8\n";
- uint16_t c[8];
+ const char *format_data = "data RAW UINT8 8\n";
+ int8_t c[8];
char command[4096];
- uint16_t data_data[256];
+ int8_t data_data[256];
int fd, n, error, r = 0;
#ifdef USE_FLAC
int i;
@@ -51,13 +51,14 @@ int main(void)
close(fd);
fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
- write(fd, data_data, 256 * sizeof(uint16_t));
+ write(fd, data_data, 256 * sizeof(uint8_t));
close(fd);
/* encode */
snprintf(command, 4096,
- "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=8 "
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
@@ -66,7 +67,7 @@ int main(void)
#else
D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN);
#endif
- n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c);
+ n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c);
error = gd_error(D);
#ifdef USE_FLAC
diff --git a/test/flac_get_little.c b/test/flac_get_little.c
index bf9760e..2585ee5 100644
--- a/test/flac_get_little.c
+++ b/test/flac_get_little.c
@@ -57,7 +57,8 @@ int main(void)
/* encode */
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_get_far.c b/test/flac_get_long.c
similarity index 75%
copy from test/flac_get_far.c
copy to test/flac_get_long.c
index c7fe450..41e0d06 100644
--- a/test/flac_get_far.c
+++ b/test/flac_get_long.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2015 D. V. Wiebe
+/* Copyright (C) 2016 D. V. Wiebe
*
***************************************************************************
*
@@ -20,9 +20,10 @@
*/
#include "test.h"
+#define N 65536
int main(void)
{
-#ifndef TEST_FLAC
+#if ! (defined TEST_FLAC && defined USE_FLAC)
return 77;
#else
const char *filedir = "dirfile";
@@ -30,49 +31,52 @@ int main(void)
const char *data = "dirfile/data";
const char *flacdata = "dirfile/data.flac";
const char *format_data = "data RAW UINT16 8\n";
- uint16_t c[8];
char command[4096];
- uint16_t data_data[256];
- int fd, n, error, r = 0;
+ uint16_t *dataw, *datar;
+ int i, fd, n, error, r = 0;
DIRFILE *D;
- memset(c, 0, 8);
rmdirfile();
mkdir(filedir, 0777);
- for (fd = 0; fd < 256; ++fd)
- data_data[fd] = (unsigned char)fd;
+ dataw = malloc(N * sizeof(*dataw));
+ datar = malloc(N * sizeof(*datar));
+
+ for (i = 0; i < N; ++i)
+ dataw[i] = i;
fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
write(fd, format_data, strlen(format_data));
close(fd);
fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
- write(fd, data_data, 256 * sizeof(uint16_t));
+ write(fd, dataw, N * sizeof(*dataw));
close(fd);
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
D = gd_open(filedir, GD_RDONLY);
- n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c);
+ n = gd_getdata(D, "data", 0, 0, 0, N, GD_UINT16, datar);
+ CHECKI(n, N);
+
error = gd_error(D);
+ CHECKI(error, 0);
gd_discard(D);
+ for (i = 0; i < N; ++i)
+ CHECKIi(i, datar[i], dataw[i]);
+
unlink(flacdata);
unlink(format);
rmdir(filedir);
-
-#ifdef USE_FLAC
- CHECKI(error, 0);
-#else
- CHECKI(error, GD_E_UNSUPPORTED);
-#endif
- CHECKI(n, 0);
+ free(dataw);
+ free(datar);
return r;
#endif
diff --git a/test/flac_nframes.c b/test/flac_nframes.c
index c451504..2fd1ed1 100644
--- a/test/flac_nframes.c
+++ b/test/flac_nframes.c
@@ -60,7 +60,8 @@ int main(void)
/* compress */
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_seek.c b/test/flac_seek.c
index 7fe2f33..1f4068e 100644
--- a/test/flac_seek.c
+++ b/test/flac_seek.c
@@ -53,7 +53,8 @@ int main(void)
/* encode */
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_seek_far.c b/test/flac_seek_far.c
index cce3a7a..61a20d4 100644
--- a/test/flac_seek_far.c
+++ b/test/flac_seek_far.c
@@ -53,7 +53,8 @@ int main(void)
/* encode */
snprintf(command, 4096,
"%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 "
- "--sign=signed --delete-input-file %s > /dev/null", FLAC, data);
+ "--sign=signed --delete-input-file %s >/dev/null 2>/dev/null", FLAC,
+ data);
if (gd_system(command))
return 1;
diff --git a/test/flac_sync.c b/test/flac_sync.c
index 86766f8..126ca46 100644
--- a/test/flac_sync.c
+++ b/test/flac_sync.c
@@ -66,8 +66,8 @@ int main(void)
/* uncompress */
snprintf(command, 4096, "%s --silent --decode --delete-input-file "
- "--force-raw-format --sign=signed --endian=little %s --output-name=%s",
- FLAC, data_flac, data);
+ "--force-raw-format --sign=signed --endian=little %s --output-name=%s "
+ ">/dev/null 2>/dev/null", FLAC, data_flac, data);
if (gd_system(command)) {
r = 1;
} else {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libgetdata.git
More information about the debian-science-commits
mailing list