[xiph-cvs] cvs commit: ogg-python/src pyoggpage.c

Andrew Chatham Master of Python andrew at xiph.org
Sun Jan 18 22:24:30 PST 2004



andrew      04/01/19 01:24:30

  Modified:    .        ChangeLog setup.py
               src      pyoggpage.c
  Log:
  2004-1-18   Andrew H. Chatham <pyogg at andrewchatham.com>
          * Wow, exactly one year between changes :)
          * pyoggpage.c(ogg_page_tostring): Provide a way to get the
          contents of a page as a string. Useful for streaming.
          * Made it version 1.4, seeing as that's the next highest number.

Revision  Changes    Path
1.15      +6 -0      ogg-python/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/ChangeLog,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ChangeLog	19 Jan 2003 00:50:15 -0000	1.14
+++ ChangeLog	19 Jan 2004 06:24:28 -0000	1.15
@@ -1,3 +1,9 @@
+2004-1-18   Andrew H. Chatham <pyogg at andrewchatham.com>
+	* Wow, exactly one year between changes :)
+	* pyoggpage.c(ogg_page_tostring): Provide a way to get the
+	contents of a page as a string. Useful for streaming.
+	* Made it version 1.4, seeing as that's the next highest number.
+	
 2003-1-18   Andrew H. Chatham <pyogg at andrewchatham.com>
         * Applied a patch from Nicodemus <nicodemus at globalite.com.br> to 
         get this to build on windows.

<p><p>1.9       +1 -1      ogg-python/setup.py

Index: setup.py
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/setup.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- setup.py	3 Jul 2003 03:11:45 -0000	1.8
+++ setup.py	19 Jan 2004 06:24:29 -0000	1.9
@@ -11,7 +11,7 @@
 from distutils.extension import Extension
 
 VERSION_MAJOR = 1
-VERSION_MINOR = 3
+VERSION_MINOR = 4
 pyogg_version = str(VERSION_MAJOR) + "." + str(VERSION_MINOR)
 
 def get_setup():

<p><p>1.5       +24 -0     ogg-python/src/pyoggpage.c

Index: pyoggpage.c
===================================================================
RCS file: /usr/local/cvsroot/ogg-python/src/pyoggpage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- pyoggpage.c	18 Feb 2002 01:19:02 -0000	1.4
+++ pyoggpage.c	19 Jan 2004 06:24:30 -0000	1.5
@@ -15,6 +15,7 @@
 static PyObject *py_ogg_page_repr(PyObject *self);
 
 FDEF(ogg_page_writeout) "Write the page to a given file object. Returns the number of bytes written.";
+FDEF(ogg_page_tostring) "Return the page data as a string.";
 FDEF(ogg_page_eos) "Tell whether this page is the end of a stream.";
 FDEF(ogg_page_version) "Return the stream version";
 FDEF(ogg_page_serialno) "Return the serial number of the page";
@@ -55,6 +56,8 @@
 static PyMethodDef py_ogg_page_methods[] = {
   {"writeout", py_ogg_page_writeout,
    METH_VARARGS, py_ogg_page_writeout_doc},
+  {"tostring", py_ogg_page_tostring,
+   METH_VARARGS, py_ogg_page_tostring_doc},
   {"eos", py_ogg_page_eos,
    METH_VARARGS, py_ogg_page_eos_doc},
   {"version", py_ogg_page_version,
@@ -118,6 +121,27 @@
 
 }
 
+/* Basically the same thing as py_ogg_page_writeout, but it returns
+   the contents as a string */
+static PyObject *
+py_ogg_page_tostring(PyObject *self, PyObject *args) 
+{
+  int bytes;
+  PyObject *ret;
+  py_ogg_page *op_self = (py_ogg_page *) self;
+
+  if (!PyArg_ParseTuple(args, ""))
+    return NULL;
+  
+  ret = PyString_FromStringAndSize(op_self->op.header, op_self->op.header_len);
+  if (ret == NULL)
+    return NULL;
+  PyString_ConcatAndDel(&ret, 
+			PyString_FromStringAndSize(op_self->op.body, 
+						   op_self->op.body_len));
+  return ret;
+}
+
 static PyObject*
 py_ogg_page_eos(PyObject *self, PyObject *args)
 {

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list