@@ -30,26 +30,26 @@ cdef extern from "unpack.h":
3030 char * encoding
3131 char * unicode_errors
3232
33- ctypedef struct template_context :
33+ ctypedef struct unpack_context :
3434 msgpack_user user
3535 PyObject* obj
3636 size_t count
3737 unsigned int ct
3838 PyObject* key
3939
40- ctypedef int (* execute_fn)(template_context * ctx, const_char_ptr data,
40+ ctypedef int (* execute_fn)(unpack_context * ctx, const_char_ptr data,
4141 size_t len , size_t* off) except ? - 1
42- execute_fn template_construct
43- execute_fn template_skip
42+ execute_fn unpack_construct
43+ execute_fn unpack_skip
4444 execute_fn read_array_header
4545 execute_fn read_map_header
46- void template_init(template_context * ctx)
47- object template_data(template_context * ctx)
46+ void unpack_init(unpack_context * ctx)
47+ object unpack_data(unpack_context * ctx)
4848
49- cdef inline init_ctx(template_context * ctx,
49+ cdef inline init_ctx(unpack_context * ctx,
5050 object object_hook, object object_pairs_hook, object list_hook,
5151 bint use_list, char * encoding, char * unicode_errors):
52- template_init (ctx)
52+ unpack_init (ctx)
5353 ctx.user.use_list = use_list
5454 ctx.user.object_hook = ctx.user.list_hook = < PyObject* > NULL
5555
@@ -88,7 +88,7 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
8888
8989 See :class:`Unpacker` for options.
9090 """
91- cdef template_context ctx
91+ cdef unpack_context ctx
9292 cdef size_t off = 0
9393 cdef int ret
9494
@@ -110,9 +110,9 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
110110 cerr = PyBytes_AsString(unicode_errors)
111111
112112 init_ctx(& ctx, object_hook, object_pairs_hook, list_hook, use_list, cenc, cerr)
113- ret = template_construct (& ctx, buf, buf_len, & off)
113+ ret = unpack_construct (& ctx, buf, buf_len, & off)
114114 if ret == 1 :
115- obj = template_data (& ctx)
115+ obj = unpack_data (& ctx)
116116 if off < buf_len:
117117 raise ExtraData(obj, PyBytes_FromStringAndSize(buf+ off, buf_len- off))
118118 return obj
@@ -194,7 +194,7 @@ cdef class Unpacker(object):
194194 for o in unpacker:
195195 process(o)
196196 """
197- cdef template_context ctx
197+ cdef unpack_context ctx
198198 cdef char * buf
199199 cdef size_t buf_size, buf_head, buf_tail
200200 cdef object file_like
@@ -324,8 +324,8 @@ cdef class Unpacker(object):
324324 write_bytes(PyBytes_FromStringAndSize(self .buf + prev_head, self .buf_head - prev_head))
325325
326326 if ret == 1 :
327- obj = template_data (& self .ctx)
328- template_init (& self .ctx)
327+ obj = unpack_data (& self .ctx)
328+ unpack_init (& self .ctx)
329329 return obj
330330 elif ret == 0 :
331331 if self .file_like is not None :
@@ -357,7 +357,7 @@ cdef class Unpacker(object):
357357
358358 Raises `OutOfData` when there are no more bytes to unpack.
359359 """
360- return self ._unpack(template_construct , write_bytes)
360+ return self ._unpack(unpack_construct , write_bytes)
361361
362362 def skip (self , object write_bytes = None ):
363363 """
@@ -368,7 +368,7 @@ cdef class Unpacker(object):
368368
369369 Raises `OutOfData` when there are no more bytes to unpack.
370370 """
371- return self ._unpack(template_skip , write_bytes)
371+ return self ._unpack(unpack_skip , write_bytes)
372372
373373 def read_array_header (self , object write_bytes = None ):
374374 """ assuming the next object is an array, return its size n, such that
@@ -390,7 +390,7 @@ cdef class Unpacker(object):
390390 return self
391391
392392 def __next__ (self ):
393- return self ._unpack(template_construct , None , 1 )
393+ return self ._unpack(unpack_construct , None , 1 )
394394
395395 # for debug.
396396 # def _buf(self):
0 commit comments