/* Generated by Pyrex 0.9.8.5 on Thu Nov 25 16:59:30 2010 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)	PyInt_AsLong(o)
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#include "python-compat.h"
#include "errno.h"
#include "unistd.h"
#include "stdlib.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "fcntl.h"
#include "dirent.h"
#include "readdir.h"


typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/

static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;

static char __pyx_mdoc[] = "Wrapper for readdir which returns files ordered by inode.";

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static void __Pyx_AddTraceback(char *funcname); /*proto*/

/* Declarations from bzrlib._readdir_pyx */


/* Declarations from implementation of bzrlib._readdir_pyx */

struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat {
  PyObject_HEAD
  struct stat _st;
};

struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader {
  PyObject_HEAD
  struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_vtab;
};



struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader {
  PyObject *(*_kind_from_mode)(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *,int);
};
static struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader;

static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx__Stat = 0;
static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx_UTF8DirReader = 0;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__directory;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__chardev;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__block;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__file;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__fifo;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__symlink;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__socket;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__unknown;
static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8;
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int,char *,PyObject *); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *); /*proto*/

static char __pyx_k1[] = "st_mode";
static char __pyx_k2[] = "st_size";
static char __pyx_k3[] = "st_mtime";
static char __pyx_k4[] = "st_ctime";
static char __pyx_k5[] = "/";
static char __pyx_k6[] = "";
static char __pyx_k7[] = "failed to strcat";
static char __pyx_k8[] = ".";
static char __pyx_k9[] = "open: ";
static char __pyx_k10[] = "chdir: ";
static char __pyx_k11[] = "opendir: ";
static char __pyx_k12[] = "readdir: ";
static char __pyx_k13[] = "lstat: ";
static char __pyx_k14[] = "closedir: ";
static char __pyx_k15[] = "return to orig_dir: ";
static char __pyx_k16[] = "os";
static char __pyx_k17[] = "sys";
static char __pyx_k18[] = "directory";
static char __pyx_k19[] = "chardev";
static char __pyx_k20[] = "block";
static char __pyx_k21[] = "file";
static char __pyx_k22[] = "fifo";
static char __pyx_k23[] = "symlink";
static char __pyx_k24[] = "socket";
static char __pyx_k25[] = "unknown";
static char __pyx_k26[] = "bzrlib";
static char __pyx_k27[] = "osutils";
static char __pyx_k28[] = "safe_utf8";

static PyObject *__pyx_n_block;
static PyObject *__pyx_n_bzrlib;
static PyObject *__pyx_n_chardev;
static PyObject *__pyx_n_directory;
static PyObject *__pyx_n_fifo;
static PyObject *__pyx_n_file;
static PyObject *__pyx_n_os;
static PyObject *__pyx_n_osutils;
static PyObject *__pyx_n_safe_utf8;
static PyObject *__pyx_n_socket;
static PyObject *__pyx_n_st_ctime;
static PyObject *__pyx_n_st_mode;
static PyObject *__pyx_n_st_mtime;
static PyObject *__pyx_n_st_size;
static PyObject *__pyx_n_symlink;
static PyObject *__pyx_n_sys;
static PyObject *__pyx_n_unknown;

static PyObject *__pyx_k5p;
static PyObject *__pyx_k6p;
static PyObject *__pyx_k7p;
static PyObject *__pyx_k8p;

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_block, 1, __pyx_k20, sizeof(__pyx_k20)},
  {&__pyx_n_bzrlib, 1, __pyx_k26, sizeof(__pyx_k26)},
  {&__pyx_n_chardev, 1, __pyx_k19, sizeof(__pyx_k19)},
  {&__pyx_n_directory, 1, __pyx_k18, sizeof(__pyx_k18)},
  {&__pyx_n_fifo, 1, __pyx_k22, sizeof(__pyx_k22)},
  {&__pyx_n_file, 1, __pyx_k21, sizeof(__pyx_k21)},
  {&__pyx_n_os, 1, __pyx_k16, sizeof(__pyx_k16)},
  {&__pyx_n_osutils, 1, __pyx_k27, sizeof(__pyx_k27)},
  {&__pyx_n_safe_utf8, 1, __pyx_k28, sizeof(__pyx_k28)},
  {&__pyx_n_socket, 1, __pyx_k24, sizeof(__pyx_k24)},
  {&__pyx_n_st_ctime, 1, __pyx_k4, sizeof(__pyx_k4)},
  {&__pyx_n_st_mode, 1, __pyx_k1, sizeof(__pyx_k1)},
  {&__pyx_n_st_mtime, 1, __pyx_k3, sizeof(__pyx_k3)},
  {&__pyx_n_st_size, 1, __pyx_k2, sizeof(__pyx_k2)},
  {&__pyx_n_symlink, 1, __pyx_k23, sizeof(__pyx_k23)},
  {&__pyx_n_sys, 1, __pyx_k17, sizeof(__pyx_k17)},
  {&__pyx_n_unknown, 1, __pyx_k25, sizeof(__pyx_k25)},
  {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)},
  {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)},
  {&__pyx_k7p, 0, __pyx_k7, sizeof(__pyx_k7)},
  {&__pyx_k8p, 0, __pyx_k8, sizeof(__pyx_k8)},
  {0, 0, 0, 0}
};

static PyObject *__pyx_d1;


/* Implementation of bzrlib._readdir_pyx */

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_dev); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_dev.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ino); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_ino.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_mode.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ctime); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_ctime.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mtime); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_mtime.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyLong_FromUnsignedLongLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_size.__get__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  PyObject *__pyx_7 = 0;
  PyObject *__pyx_8 = 0;
  PyObject *__pyx_9 = 0;
  PyObject *__pyx_10 = 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_size); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  __pyx_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_mtime); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_ctime); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
  __pyx_10 = PyTuple_New(10); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_10, 0, __pyx_1);
  PyTuple_SET_ITEM(__pyx_10, 1, __pyx_2);
  PyTuple_SET_ITEM(__pyx_10, 2, __pyx_3);
  PyTuple_SET_ITEM(__pyx_10, 3, __pyx_4);
  PyTuple_SET_ITEM(__pyx_10, 4, __pyx_5);
  PyTuple_SET_ITEM(__pyx_10, 5, __pyx_6);
  PyTuple_SET_ITEM(__pyx_10, 6, __pyx_7);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_10, 7, Py_None);
  PyTuple_SET_ITEM(__pyx_10, 8, __pyx_8);
  PyTuple_SET_ITEM(__pyx_10, 9, __pyx_9);
  __pyx_1 = 0;
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_4 = 0;
  __pyx_5 = 0;
  __pyx_6 = 0;
  __pyx_7 = 0;
  __pyx_8 = 0;
  __pyx_9 = 0;
  __pyx_1 = PyObject_Repr(__pyx_10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
  Py_DECREF(__pyx_10); __pyx_10 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  Py_XDECREF(__pyx_7);
  Py_XDECREF(__pyx_8);
  Py_XDECREF(__pyx_9);
  Py_XDECREF(__pyx_10);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.__repr__");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode[] = "Get the kind of a path from a mode status.";
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_mode;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  static char *__pyx_argnames[] = {"mode",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_mode)) return 0;
  Py_INCREF(__pyx_v_self);
  __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self),__pyx_v_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.kind_from_mode");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_v_self,int __pyx_v_mode) {
  PyObject *__pyx_r;
  int __pyx_1;
  Py_INCREF(__pyx_v_self);

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":183 */
  __pyx_1 = S_ISREG(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__file);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__file;
    goto __pyx_L0;
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":185 */
  __pyx_1 = S_ISDIR(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__directory);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__directory;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":187 */
  __pyx_1 = S_ISCHR(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__chardev;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":189 */
  __pyx_1 = S_ISBLK(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__block);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__block;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":191 */
  __pyx_1 = S_ISLNK(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__symlink;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":193 */
  __pyx_1 = S_ISFIFO(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__fifo;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":195 */
  __pyx_1 = S_ISSOCK(__pyx_v_mode);
  if (__pyx_1) {
    Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__socket);
    __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__socket;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":197 */
  Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown);
  __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__unknown;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir[] = "See DirReader.top_prefix_to_starting_dir.";
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_top = 0;
  PyObject *__pyx_v_prefix = 0;
  PyObject *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  static char *__pyx_argnames[] = {"top","prefix",0};
  __pyx_v_prefix = __pyx_d1;
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_top, &__pyx_v_prefix)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_top);
  Py_INCREF(__pyx_v_prefix);
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
  Py_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_prefix);
  __pyx_2 = PyObject_CallObject(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
  Py_INCREF(__pyx_v_top);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_top);
  __pyx_3 = PyObject_CallObject(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyTuple_New(5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_1, 1, Py_None);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_1, 2, Py_None);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_1, 3, Py_None);
  PyTuple_SET_ITEM(__pyx_1, 4, __pyx_3);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.top_prefix_to_starting_dir");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_top);
  Py_DECREF(__pyx_v_prefix);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir[] = "Read a single directory from a utf8 file system.\n\n        All paths in and out are utf8.\n\n        This sub-function is called when we know the filesystem is already in utf8\n        encoding. So we don\'t need to transcode filenames.\n\n        See DirReader.read_dir for details.\n        ";
static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_prefix = 0;
  PyObject *__pyx_v_top = 0;
  PyObject *__pyx_v_newval;
  int __pyx_v_index;
  int __pyx_v_length;
  void *__pyx_v_atuple;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_new_val_obj;
  PyObject *__pyx_v_relprefix;
  PyObject *__pyx_v_top_slash;
  PyObject *__pyx_v_result;
  PyObject *__pyx_r;
  Py_ssize_t __pyx_1;
  PyObject *__pyx_2 = 0;
  int __pyx_3;
  PyObject *__pyx_4 = 0;
  static char *__pyx_argnames[] = {"prefix","top",0};
  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_top)) return 0;
  Py_INCREF(__pyx_v_self);
  Py_INCREF(__pyx_v_prefix);
  Py_INCREF(__pyx_v_top);
  __pyx_v_newval = Py_None; Py_INCREF(Py_None);
  __pyx_v_name = Py_None; Py_INCREF(Py_None);
  __pyx_v_relprefix = Py_None; Py_INCREF(Py_None);
  __pyx_v_top_slash = Py_None; Py_INCREF(Py_None);
  __pyx_v_result = Py_None; Py_INCREF(Py_None);

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":223 */
  __pyx_1 = PyString_Size(__pyx_v_prefix);
  if (__pyx_1) {
    __pyx_2 = PyNumber_Add(__pyx_v_prefix, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;}
    Py_DECREF(__pyx_v_relprefix);
    __pyx_v_relprefix = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L2;
  }
  /*else*/ {
    Py_INCREF(__pyx_k6p);
    Py_DECREF(__pyx_v_relprefix);
    __pyx_v_relprefix = __pyx_k6p;
  }
  __pyx_L2:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":227 */
  __pyx_2 = PyNumber_Add(__pyx_v_top, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;}
  Py_DECREF(__pyx_v_top_slash);
  __pyx_v_top_slash = __pyx_2;
  __pyx_2 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":231 */
  __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx__read_dir(__pyx_v_top); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":232 */
  __pyx_1 = PyObject_Length(__pyx_v_result); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;}
  __pyx_v_length = __pyx_1;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":234 */
  for (__pyx_v_index = 0; __pyx_v_index < __pyx_v_length; ++__pyx_v_index) {

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":235 */
    __pyx_v_atuple = PyList_GET_ITEM(__pyx_v_result,__pyx_v_index);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":236 */
    Py_INCREF(((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,1)));
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = ((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,1));

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":241 */
    __pyx_v_new_val_obj = ((PyObject *)__pyx_v_relprefix);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":242 */
    Py_INCREF(__pyx_v_relprefix);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":243 */
    PyString_Concat((&__pyx_v_new_val_obj),__pyx_v_name);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":244 */
    __pyx_3 = (NULL == __pyx_v_new_val_obj);
    if (__pyx_3) {
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
      Py_INCREF(__pyx_k7p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p);
      __pyx_4 = PyObject_CallObject(PyExc_Exception, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __Pyx_Raise(__pyx_4, 0, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":248 */
    __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,0,__pyx_v_new_val_obj); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;}

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":250 */
    __pyx_2 = PyObject_GetAttr(((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,3)), __pyx_n_st_mode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;}
    __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self),__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;}
    Py_DECREF(__pyx_v_newval);
    __pyx_v_newval = __pyx_4;
    __pyx_4 = 0;

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":252 */
    Py_INCREF(__pyx_v_newval);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":253 */
    __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,2,__pyx_v_newval); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;}

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":257 */
    __pyx_v_new_val_obj = ((PyObject *)__pyx_v_top_slash);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":258 */
    Py_INCREF(__pyx_v_top_slash);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":259 */
    PyString_Concat((&__pyx_v_new_val_obj),__pyx_v_name);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":260 */
    __pyx_3 = (NULL == __pyx_v_new_val_obj);
    if (__pyx_3) {
      __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
      Py_INCREF(__pyx_k7p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p);
      __pyx_4 = PyObject_CallObject(PyExc_Exception, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __Pyx_Raise(__pyx_4, 0, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":264 */
    __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,4,__pyx_v_new_val_obj); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;}
  }

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":265 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_4);
  __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.read_dir");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_newval);
  Py_DECREF(__pyx_v_name);
  Py_DECREF(__pyx_v_relprefix);
  Py_DECREF(__pyx_v_top_slash);
  Py_DECREF(__pyx_v_result);
  Py_DECREF(__pyx_v_self);
  Py_DECREF(__pyx_v_prefix);
  Py_DECREF(__pyx_v_top);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int __pyx_v_errnum,char *__pyx_v_msg_prefix,PyObject *__pyx_v_path) {
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_4 = 0;
  PyObject *__pyx_5 = 0;
  Py_INCREF(__pyx_v_path);

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":269 */
  __pyx_1 = (__pyx_v_errnum == EINTR);
  if (__pyx_1) {
    __pyx_1 = PyErr_CheckSignals(); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;}
    goto __pyx_L2;
  }
  __pyx_L2:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":271 */
  __pyx_2 = PyInt_FromLong(__pyx_v_errnum); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_3 = PyString_FromString(__pyx_v_msg_prefix); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(strerror(__pyx_v_errnum)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  __pyx_5 = PyNumber_Add(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5);
  Py_INCREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_path);
  __pyx_2 = 0;
  __pyx_5 = 0;
  __pyx_4 = PyObject_CallObject(PyExc_OSError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, 0, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_3);
  Py_XDECREF(__pyx_4);
  Py_XDECREF(__pyx_5);
  __Pyx_AddTraceback("bzrlib._readdir_pyx.raise_os_error");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_path);
  return __pyx_r;
}

static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *__pyx_v_path) {
  DIR *__pyx_v_the_dir;
  dirent *__pyx_v_entry;
  dirent __pyx_v_sentinel;
  char *__pyx_v_name;
  int __pyx_v_stat_result;
  struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *__pyx_v_statvalue;
  int __pyx_v_orig_dir_fd;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_failed;
  PyObject *__pyx_r;
  int __pyx_1;
  PyObject *__pyx_2 = 0;
  char *__pyx_3;
  int __pyx_4;
  PyObject *__pyx_5 = 0;
  PyObject *__pyx_6 = 0;
  Py_INCREF(__pyx_v_path);
  __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)Py_None); Py_INCREF(Py_None);
  __pyx_v_result = Py_None; Py_INCREF(Py_None);
  __pyx_v_failed = Py_None; Py_INCREF(Py_None);

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":295 */
  if (PyObject_Cmp(__pyx_v_path, __pyx_k6p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;}
  __pyx_1 = __pyx_1 != 0;
  if (__pyx_1) {
    if (PyObject_Cmp(__pyx_v_path, __pyx_k8p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;}
    __pyx_1 = __pyx_1 != 0;
  }
  if (__pyx_1) {

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":299 */
    __pyx_v_orig_dir_fd = open(__pyx_k8,O_RDONLY,0);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":300 */
    __pyx_1 = (__pyx_v_orig_dir_fd == (-1));
    if (__pyx_1) {
      __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k9,__pyx_k8p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      goto __pyx_L3;
    }
    __pyx_L3:;

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":302 */
    __pyx_3 = PyString_AsString(__pyx_v_path); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;}
    __pyx_1 = ((-1) == chdir(__pyx_3));
    if (__pyx_1) {

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":305 */
      close(__pyx_v_orig_dir_fd);

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":306 */
      __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k10,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L2;
  }
  /*else*/ {
    __pyx_v_orig_dir_fd = (-1);
  }
  __pyx_L2:;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":310 */
  /*try:*/ {

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":311 */
    __pyx_v_the_dir = opendir(__pyx_k8);

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":312 */
    __pyx_1 = (NULL == __pyx_v_the_dir);
    if (__pyx_1) {
      __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k11,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L6;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":314 */
    /*try:*/ {

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":315 */
      __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L10;}
      Py_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_2;
      __pyx_2 = 0;

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":316 */
      __pyx_v_entry = (&__pyx_v_sentinel);

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":317 */
      while (1) {
        __pyx_1 = (__pyx_v_entry != NULL);
        if (!__pyx_1) break;

        /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":321 */
        while (1) {
          __pyx_1 = PyObject_IsTrue(Py_True); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L10;}
          if (!__pyx_1) break;

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":322 */
          errno = 0;

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":323 */
          __pyx_v_entry = readdir(__pyx_v_the_dir);

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":324 */
          __pyx_1 = (__pyx_v_entry == NULL);
          if (__pyx_1) {
            __pyx_1 = (errno == EAGAIN);
            if (!__pyx_1) {
              __pyx_1 = (errno == EINTR);
            }
          }
          if (__pyx_1) {

            /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":325 */
            __pyx_1 = (errno == EINTR);
            if (__pyx_1) {
              __pyx_1 = PyErr_CheckSignals(); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L10;}
              goto __pyx_L17;
            }
            __pyx_L17:;

            /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":328 */
            goto __pyx_L14;
            goto __pyx_L16;
          }
          /*else*/ {
            goto __pyx_L15;
          }
          __pyx_L16:;
          __pyx_L14:;
        }
        __pyx_L15:;

        /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":331 */
        __pyx_1 = (__pyx_v_entry == NULL);
        if (__pyx_1) {
          __pyx_1 = (errno == ENOTDIR);
          if (!__pyx_1) {
            __pyx_1 = (errno == 0);
          }
          if (__pyx_1) {
            goto __pyx_L12;
            goto __pyx_L19;
          }
          /*else*/ {
            __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k12,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L10;}
            Py_DECREF(__pyx_2); __pyx_2 = 0;
          }
          __pyx_L19:;
          goto __pyx_L18;
        }
        __pyx_L18:;

        /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":339 */
        __pyx_v_name = __pyx_v_entry->d_name;

        /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":340 */
        __pyx_1 = ((__pyx_v_name[0]) == '.');
        if (__pyx_1) {
          __pyx_1 = ((__pyx_v_name[1]) == 0);
          if (!__pyx_1) {
            __pyx_1 = ((__pyx_v_name[1]) == '.');
            if (__pyx_1) {
              __pyx_1 = ((__pyx_v_name[2]) == 0);
            }
          }
        }
        __pyx_4 = (!__pyx_1);
        if (__pyx_4) {

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":344 */
          __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_12_readdir_pyx__Stat), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L10;}
          Py_DECREF(((PyObject *)__pyx_v_statvalue));
          __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_2);
          __pyx_2 = 0;

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":345 */
          __pyx_v_stat_result = lstat(__pyx_v_entry->d_name,(&__pyx_v_statvalue->_st));

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":346 */
          __pyx_1 = (__pyx_v_stat_result != 0);
          if (__pyx_1) {
            __pyx_4 = (errno != ENOENT);
            if (__pyx_4) {
              __pyx_2 = PyNumber_Add(__pyx_v_path, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;}
              __pyx_5 = PyString_FromString(__pyx_v_entry->d_name); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;}
              __pyx_6 = PyNumber_Add(__pyx_2, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;}
              Py_DECREF(__pyx_2); __pyx_2 = 0;
              Py_DECREF(__pyx_5); __pyx_5 = 0;
              __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k13,__pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L10;}
              Py_DECREF(__pyx_6); __pyx_6 = 0;
              Py_DECREF(__pyx_2); __pyx_2 = 0;
              goto __pyx_L22;
            }
            /*else*/ {
              goto __pyx_L12;
            }
            __pyx_L22:;
            goto __pyx_L21;
          }
          __pyx_L21:;

          /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":362 */
          __pyx_5 = PyLong_FromUnsignedLong(__pyx_v_entry->d_ino); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;}
          __pyx_6 = PyString_FromString(__pyx_v_entry->d_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;}
          __pyx_2 = PyTuple_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;}
          PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5);
          PyTuple_SET_ITEM(__pyx_2, 1, __pyx_6);
          Py_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_2, 2, Py_None);
          Py_INCREF(((PyObject *)__pyx_v_statvalue));
          PyTuple_SET_ITEM(__pyx_2, 3, ((PyObject *)__pyx_v_statvalue));
          Py_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_2, 4, Py_None);
          __pyx_5 = 0;
          __pyx_6 = 0;
          __pyx_1 = PyList_Append(__pyx_v_result,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;}
          Py_DECREF(__pyx_2); __pyx_2 = 0;
          goto __pyx_L20;
        }
        __pyx_L20:;
        __pyx_L12:;
      }
    }
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_why = 0; goto __pyx_L11;
      __pyx_L10: {
        __pyx_why = 4;
        Py_XDECREF(__pyx_5); __pyx_5 = 0;
        Py_XDECREF(__pyx_6); __pyx_6 = 0;
        Py_XDECREF(__pyx_2); __pyx_2 = 0;
        PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L11;
      }
      __pyx_L11:;
      __pyx_4 = ((-1) == closedir(__pyx_v_the_dir));
      if (__pyx_4) {
        __pyx_5 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k14,__pyx_v_path); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L23;}
        Py_DECREF(__pyx_5); __pyx_5 = 0;
        goto __pyx_L24;
      }
      __pyx_L24:;
      goto __pyx_L25;
      __pyx_L23:;
      if (__pyx_why == 4) {
        Py_XDECREF(__pyx_exc_type);
        Py_XDECREF(__pyx_exc_value);
        Py_XDECREF(__pyx_exc_tb);
      }
      goto __pyx_L6;
      __pyx_L25:;
      switch (__pyx_why) {
        case 4: {
          PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L6;
        }
      }
    }
  }
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_why = 0; goto __pyx_L7;
    __pyx_L6: {
      __pyx_why = 4;
      Py_XDECREF(__pyx_6); __pyx_6 = 0;
      Py_XDECREF(__pyx_2); __pyx_2 = 0;
      Py_XDECREF(__pyx_5); __pyx_5 = 0;
      PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L7;
    }
    __pyx_L7:;
    __pyx_1 = ((-1) != __pyx_v_orig_dir_fd);
    if (__pyx_1) {

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":369 */
      Py_INCREF(Py_False);
      Py_DECREF(__pyx_v_failed);
      __pyx_v_failed = Py_False;

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":370 */
      __pyx_4 = ((-1) == fchdir(__pyx_v_orig_dir_fd));
      if (__pyx_4) {
        Py_INCREF(Py_True);
        Py_DECREF(__pyx_v_failed);
        __pyx_v_failed = Py_True;
        goto __pyx_L28;
      }
      __pyx_L28:;

      /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":373 */
      __pyx_6 = PyInt_FromLong(((-1) == close(__pyx_v_orig_dir_fd))); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;}
      __pyx_1 = PyObject_IsTrue(__pyx_6); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;}
      if (!__pyx_1) {
        Py_DECREF(__pyx_6); __pyx_6 = 0;
        __pyx_6 = __pyx_v_failed;
        Py_INCREF(__pyx_6);
      }
      __pyx_4 = PyObject_IsTrue(__pyx_6); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      if (__pyx_4) {
        __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k15,__pyx_k6p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L26;}
        Py_DECREF(__pyx_2); __pyx_2 = 0;
        goto __pyx_L29;
      }
      __pyx_L29:;
      goto __pyx_L27;
    }
    __pyx_L27:;
    goto __pyx_L30;
    __pyx_L26:;
    if (__pyx_why == 4) {
      Py_XDECREF(__pyx_exc_type);
      Py_XDECREF(__pyx_exc_value);
      Py_XDECREF(__pyx_exc_tb);
    }
    goto __pyx_L1;
    __pyx_L30:;
    switch (__pyx_why) {
      case 4: {
        PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1;
      }
    }
  }

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":376 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1:;
  Py_XDECREF(__pyx_2);
  Py_XDECREF(__pyx_5);
  Py_XDECREF(__pyx_6);
  __Pyx_AddTraceback("bzrlib._readdir_pyx._read_dir");
  __pyx_r = 0;
  __pyx_L0:;
  Py_DECREF(__pyx_v_statvalue);
  Py_DECREF(__pyx_v_result);
  Py_DECREF(__pyx_v_failed);
  Py_DECREF(__pyx_v_path);
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6bzrlib_12_readdir_pyx__Stat(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6bzrlib_12_readdir_pyx__Stat(PyObject *o) {
  (*o->ob_type->tp_free)(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_dev(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ino(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mode(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ctime(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mtime(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_size(PyObject *o, void *x) {
  return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(o);
}

static struct PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx__Stat[] = {
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6bzrlib_12_readdir_pyx__Stat[] = {
  {"st_dev", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_dev, 0, 0, 0},
  {"st_ino", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ino, 0, 0, 0},
  {"st_mode", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mode, 0, 0, 0},
  {"st_ctime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ctime, 0, 0, 0},
  {"st_mtime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mtime, 0, 0, 0},
  {"st_size", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_size, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Stat = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence__Stat = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Stat = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Stat = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx__Stat = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "bzrlib._readdir_pyx._Stat", /*tp_name*/
  sizeof(struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6bzrlib_12_readdir_pyx__Stat, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__, /*tp_repr*/
  &__pyx_tp_as_number__Stat, /*tp_as_number*/
  &__pyx_tp_as_sequence__Stat, /*tp_as_sequence*/
  &__pyx_tp_as_mapping__Stat, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer__Stat, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Represent a \'stat\' result.", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6bzrlib_12_readdir_pyx__Stat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6bzrlib_12_readdir_pyx__Stat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6bzrlib_12_readdir_pyx__Stat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader __pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader;

static PyObject *__pyx_tp_new_6bzrlib_12_readdir_pyx_UTF8DirReader(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)o);
  *(struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader;
  return o;
}

static void __pyx_tp_dealloc_6bzrlib_12_readdir_pyx_UTF8DirReader(PyObject *o) {
  (*o->ob_type->tp_free)(o);
}

static struct PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx_UTF8DirReader[] = {
  {"kind_from_mode", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode},
  {"top_prefix_to_starting_dir", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir},
  {"read_dir", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_UTF8DirReader = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_divide*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_coerce*/
  0, /*nb_int*/
  0, /*nb_long*/
  0, /*nb_float*/
  0, /*nb_oct*/
  0, /*nb_hex*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  0, /*nb_inplace_divide*/
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_UTF8DirReader = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_UTF8DirReader = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_UTF8DirReader = {
  0, /*bf_getreadbuffer*/
  0, /*bf_getwritebuffer*/
  0, /*bf_getsegcount*/
  0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader = {
  PyObject_HEAD_INIT(0)
  0, /*ob_size*/
  "bzrlib._readdir_pyx.UTF8DirReader", /*tp_name*/
  sizeof(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6bzrlib_12_readdir_pyx_UTF8DirReader, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_UTF8DirReader, /*tp_as_number*/
  &__pyx_tp_as_sequence_UTF8DirReader, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_UTF8DirReader, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_UTF8DirReader, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "A dir reader for utf8 file systems.", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6bzrlib_12_readdir_pyx_UTF8DirReader, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6bzrlib_12_readdir_pyx_UTF8DirReader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC init_readdir_pyx(void); /*proto*/
PyMODINIT_FUNC init_readdir_pyx(void) {
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  __pyx_init_filenames();
  __pyx_m = Py_InitModule4("_readdir_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
  Py_INCREF(__pyx_m);
  __pyx_b = PyImport_AddModule("__builtin__");
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;};
  __pyx_v_6bzrlib_12_readdir_pyx__directory = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__chardev = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__block = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__file = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__fifo = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__symlink = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__socket = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__unknown = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = Py_None; Py_INCREF(Py_None);
  if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "_Stat", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
  __pyx_ptype_6bzrlib_12_readdir_pyx__Stat = &__pyx_type_6bzrlib_12_readdir_pyx__Stat;
  __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader = &__pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader;
  *(void(**)(void))&__pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader._kind_from_mode = (void(*)(void))__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode;
  if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
  if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader.tp_dict, __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
  if (PyObject_SetAttrString(__pyx_m, "UTF8DirReader", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_ptype_6bzrlib_12_readdir_pyx_UTF8DirReader = &__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":20 */
  __pyx_1 = __Pyx_Import(__pyx_n_os, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_os, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":21 */
  __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":110 */
  Py_INCREF(__pyx_n_directory);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__directory);
  __pyx_v_6bzrlib_12_readdir_pyx__directory = __pyx_n_directory;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":112 */
  Py_INCREF(__pyx_n_chardev);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev);
  __pyx_v_6bzrlib_12_readdir_pyx__chardev = __pyx_n_chardev;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":114 */
  Py_INCREF(__pyx_n_block);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__block);
  __pyx_v_6bzrlib_12_readdir_pyx__block = __pyx_n_block;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":116 */
  Py_INCREF(__pyx_n_file);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__file);
  __pyx_v_6bzrlib_12_readdir_pyx__file = __pyx_n_file;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":118 */
  Py_INCREF(__pyx_n_fifo);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo);
  __pyx_v_6bzrlib_12_readdir_pyx__fifo = __pyx_n_fifo;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":120 */
  Py_INCREF(__pyx_n_symlink);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink);
  __pyx_v_6bzrlib_12_readdir_pyx__symlink = __pyx_n_symlink;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":122 */
  Py_INCREF(__pyx_n_socket);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__socket);
  __pyx_v_6bzrlib_12_readdir_pyx__socket = __pyx_n_socket;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":124 */
  Py_INCREF(__pyx_n_unknown);
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown);
  __pyx_v_6bzrlib_12_readdir_pyx__unknown = __pyx_n_unknown;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":169 */
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_INCREF(__pyx_n_osutils);
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_osutils);
  __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_osutils); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_m, __pyx_n_osutils, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":172 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_osutils); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_safe_utf8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8);
  __pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = __pyx_1;
  __pyx_1 = 0;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":199 */
  Py_INCREF(__pyx_k6p);
  __pyx_d1 = __pyx_k6p;

  /* "/home/vila/src/bzr/releases/prepare-2.2.2/bzrlib/_readdir_pyx.pyx":274 */
  return;
  __pyx_L1:;
  Py_XDECREF(__pyx_1);
  Py_XDECREF(__pyx_2);
  __Pyx_AddTraceback("bzrlib._readdir_pyx");
}

static char *__pyx_filenames[] = {
  "_readdir_pyx.pyx",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) type->ob_type;
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        if (t->i)
            PyString_InternInPlace(t->p);
        ++t;
    }
    return 0;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
    PyObject *pycobj = 0;
    int result;
    
    pycobj = PyCObject_FromVoidPtr(vtable, 0);
    if (!pycobj)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunction(__import__, "OOOO",
        name, global_dict, empty_dict, list);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyObject *empty_tuple = 0;
    PyObject *empty_string = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    
    py_srcfile = PyString_FromString(__pyx_filename);
    if (!py_srcfile) goto bad;
    py_funcname = PyString_FromString(funcname);
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    empty_tuple = PyTuple_New(0);
    if (!empty_tuple) goto bad;
    empty_string = PyString_FromString("");
    if (!empty_string) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        empty_tuple,  /*PyObject *consts,*/
        empty_tuple,  /*PyObject *names,*/
        empty_tuple,  /*PyObject *varnames,*/
        empty_tuple,  /*PyObject *freevars,*/
        empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(empty_tuple);
    Py_XDECREF(empty_string);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
