# PySoy storage declarations # # Copyright (C) 2006,2007,2008 PySoy Group # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program; if not, see http://www.gnu.org/licenses # # $Id$ cimport ogg cimport py cimport stdio cimport soy._internals cdef struct Stored : int serialno unsigned char namelen char name[256] void *object cdef class Transport (soy._internals.Loopable) : cdef Stored* _objs cdef object _dict cdef int _mobj cdef int _nobj cdef int _vers # <-9=error, -1=empty, 0=ogg, >0=soy cdef int _mode # 0 = idle, 1 = load, 2 = save # for Ogg cdef int _oggLoop cdef ogg.ogg_sync_state _sync # # General Functions cdef int _initObjt ( self, int, object, object ) cdef int _indexName ( self, char*, unsigned char ) nogil cdef int _indexSerial ( self, int ) nogil # # Transport-specific functions cdef int _open ( self, object ) cdef int _read ( self, char*, int ) nogil cdef int _write ( self, char*, int ) nogil cdef int _goto ( self, long ) nogil cdef int _seek ( self, long ) nogil cdef long _tell ( self ) nogil cdef void _rewind ( self ) nogil cdef void _close ( self ) nogil # # Soy functions cdef void _soyHead ( self ) cdef void _soyLoad ( self ) nogil cdef void _soyRead ( self, char*, int ) nogil # # Ogg functions cdef void _oggHead ( self ) cdef void _oggLoad ( self ) nogil cdef int _oggReadPage ( self, ogg.ogg_page* ) nogil cdef class File (Transport) : cdef void* _file